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 <t-kristo@ti.com>
7  */
8 
9 #ifndef __CRYPTO_OMAP_CRYPTO_H
10 #define __CRYPTO_OMAP_CRYPTO_H
11 
12 enum {
13 	OMAP_CRYPTO_NOT_ALIGNED = 1,
14 	OMAP_CRYPTO_BAD_DATA_LENGTH,
15 };
16 
17 #define OMAP_CRYPTO_DATA_COPIED		BIT(0)
18 #define OMAP_CRYPTO_SG_COPIED		BIT(1)
19 
20 #define OMAP_CRYPTO_COPY_MASK		0x3
21 
22 #define OMAP_CRYPTO_COPY_DATA		BIT(0)
23 #define OMAP_CRYPTO_FORCE_COPY		BIT(1)
24 #define OMAP_CRYPTO_ZERO_BUF		BIT(2)
25 #define OMAP_CRYPTO_FORCE_SINGLE_ENTRY	BIT(3)
26 
27 int omap_crypto_align_sg(struct scatterlist **sg, int total, int bs,
28 			 struct scatterlist *new_sg, u16 flags,
29 			 u8 flags_shift, unsigned long *dd_flags);
30 void omap_crypto_cleanup(struct scatterlist *sg, struct scatterlist *orig,
31 			 int offset, int len, u8 flags_shift,
32 			 unsigned long flags);
33 
34 #endif
35