xref: /linux/drivers/crypto/omap-crypto.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
274ed87e7STero Kristo /*
374ed87e7STero Kristo  * OMAP Crypto driver common support routines.
474ed87e7STero Kristo  *
574ed87e7STero Kristo  * Copyright (c) 2017 Texas Instruments Incorporated
674ed87e7STero Kristo  *   Tero Kristo <t-kristo@ti.com>
774ed87e7STero Kristo  */
874ed87e7STero Kristo 
974ed87e7STero Kristo #ifndef __CRYPTO_OMAP_CRYPTO_H
1074ed87e7STero Kristo #define __CRYPTO_OMAP_CRYPTO_H
1174ed87e7STero Kristo 
1274ed87e7STero Kristo enum {
1374ed87e7STero Kristo 	OMAP_CRYPTO_NOT_ALIGNED = 1,
1474ed87e7STero Kristo 	OMAP_CRYPTO_BAD_DATA_LENGTH,
1574ed87e7STero Kristo };
1674ed87e7STero Kristo 
1774ed87e7STero Kristo #define OMAP_CRYPTO_DATA_COPIED		BIT(0)
1874ed87e7STero Kristo #define OMAP_CRYPTO_SG_COPIED		BIT(1)
1974ed87e7STero Kristo 
2074ed87e7STero Kristo #define OMAP_CRYPTO_COPY_MASK		0x3
2174ed87e7STero Kristo 
2274ed87e7STero Kristo #define OMAP_CRYPTO_COPY_DATA		BIT(0)
2374ed87e7STero Kristo #define OMAP_CRYPTO_FORCE_COPY		BIT(1)
2474ed87e7STero Kristo #define OMAP_CRYPTO_ZERO_BUF		BIT(2)
2574ed87e7STero Kristo #define OMAP_CRYPTO_FORCE_SINGLE_ENTRY	BIT(3)
2674ed87e7STero Kristo 
2774ed87e7STero Kristo int omap_crypto_align_sg(struct scatterlist **sg, int total, int bs,
2874ed87e7STero Kristo 			 struct scatterlist *new_sg, u16 flags,
2974ed87e7STero Kristo 			 u8 flags_shift, unsigned long *dd_flags);
3074ed87e7STero Kristo void omap_crypto_cleanup(struct scatterlist *sg, struct scatterlist *orig,
3174ed87e7STero Kristo 			 int offset, int len, u8 flags_shift,
3274ed87e7STero Kristo 			 unsigned long flags);
3374ed87e7STero Kristo 
3474ed87e7STero Kristo #endif
35