xref: /openbmc/linux/drivers/crypto/omap-crypto.h (revision c8ec3743)
1 /*
2  * OMAP Crypto driver common support routines.
3  *
4  * Copyright (c) 2017 Texas Instruments Incorporated
5  *   Tero Kristo <t-kristo@ti.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as published
9  * by the Free Software Foundation.
10  */
11 
12 #ifndef __CRYPTO_OMAP_CRYPTO_H
13 #define __CRYPTO_OMAP_CRYPTO_H
14 
15 enum {
16 	OMAP_CRYPTO_NOT_ALIGNED = 1,
17 	OMAP_CRYPTO_BAD_DATA_LENGTH,
18 };
19 
20 #define OMAP_CRYPTO_DATA_COPIED		BIT(0)
21 #define OMAP_CRYPTO_SG_COPIED		BIT(1)
22 
23 #define OMAP_CRYPTO_COPY_MASK		0x3
24 
25 #define OMAP_CRYPTO_COPY_DATA		BIT(0)
26 #define OMAP_CRYPTO_FORCE_COPY		BIT(1)
27 #define OMAP_CRYPTO_ZERO_BUF		BIT(2)
28 #define OMAP_CRYPTO_FORCE_SINGLE_ENTRY	BIT(3)
29 
30 int omap_crypto_align_sg(struct scatterlist **sg, int total, int bs,
31 			 struct scatterlist *new_sg, u16 flags,
32 			 u8 flags_shift, unsigned long *dd_flags);
33 void omap_crypto_cleanup(struct scatterlist *sg, struct scatterlist *orig,
34 			 int offset, int len, u8 flags_shift,
35 			 unsigned long flags);
36 
37 #endif
38