crypto: add support for the Freescale SEC4/CAAM
PATCH 3/3 crypto: add support for the Freescale SEC4/CAAM
The SEC4 supercedes the SEC2.x/3.x as Freescale's Integrated Security Engine. Its programming model is incompatible with all prior versions of the SEC (talitos).
The SEC4 is also known as the Cryptographic Accelerator and Assurance Module (CAAM); this driver is named caam.
This initial submission does not include support for Data Path mode operation - AEAD descriptors are submitted via the job ring interface, while the Queue Interface (QI) is enabled for use by others. Only AEAD algorithms are implemented at this time, for use with IPsec.
Many thanks to the Freescale STC team for their contributions to this driver.
---
Documentation for this device has not been released to the public yet. A high level description of the device is available on pp. 44-51 of:
http://www.freescale.com/files/ftf_2010/Americas/WBNR_FTF10_NET_F0446_PDF.pdf
drivers/crypto/Kconfig | 2 + drivers/crypto/Makefile | 1 + drivers/crypto/caam/Kconfig | 72 +++ drivers/crypto/caam/Makefile | 8 + drivers/crypto/caam/caamalg.c | 1163 +++++++++++++++++++++++++++++++++++++ drivers/crypto/caam/compat.h | 35 ++ drivers/crypto/caam/ctrl.c | 270 +++++++++ drivers/crypto/caam/desc_constr.h | 204 +++++++ drivers/crypto/caam/error.c | 248 ++++++++ drivers/crypto/caam/error.h | 10 + drivers/crypto/caam/intern.h | 113 ++++ drivers/crypto/caam/jr.c | 523 +++++++++++++++++ drivers/crypto/caam/jr.h | 21 + 13 files changed, 2670 insertions(+), 0 deletions(-) create mode 100644 drivers/crypto/caam/Kconfig create mode 100644 drivers/crypto/caam/Makefile create mode 100644 drivers/crypto/caam/caamalg.c create mode 100644 drivers/crypto/caam/compat.h create mode 100644 drivers/crypto/caam/ctrl.c create mode 100644 drivers/crypto/caam/desc_constr.h create mode 100644 drivers/crypto/caam/error.c create mode 100644 drivers/crypto/caam/error.h create mode 100644 drivers/crypto/caam/intern.h create mode 100644 drivers/crypto/caam/jr.c create mode 100644 drivers/crypto/caam/jr.h
drivers/crypto/Kconfig +2 -0
@@ -200,6 +200,8 @@ config CRYPTO_DEV_HIFN_795X_RNG Select this option if you want to enable the random number generator on the HIFN 795x crypto adapters. +source drivers/crypto/caam/Kconfig + config CRYPTO_DEV_TALITOS tristate "Talitos Freescale Security Engine (SEC)" select CRYPTO_ALGAPI
drivers/crypto/Makefile +1 -0
@@ -6,6 +6,7 @@ n2_crypto-y := n2_core.o n2_asm.o obj-$(CONFIG_CRYPTO_DEV_HIFN_795X) += hifn_795x.o obj-$(CONFIG_CRYPTO_DEV_MV_CESA) += mv_cesa.o obj-$(CONFIG_CRYPTO_DEV_TALITOS) += talitos.o +obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM) += caam/ obj-$(CONFIG_CRYPTO_DEV_IXP4XX) += ixp4xx_crypto.o obj-$(CONFIG_CRYPTO_DEV_PPC4XX) += amcc/ obj-$(CONFIG_CRYPTO_DEV_OMAP_SHAM) += omap-sham.o
drivers/crypto/caam/Kconfig new file +72 -0
72 lines not on this page · raw message
drivers/crypto/caam/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# +# Makefile for the CAAM backend and dependent components +# + +obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM) += caam.o +obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API) += caamalg.o + +caam-objs := ctrl.o jr.o error.o
drivers/crypto/caam/caamalg.c new file +1163 -0
1,163 lines not on this page · raw message
drivers/crypto/caam/compat.h new file +35 -0
@@ -0,0 +1,35 @@ +/* +* Copyright 2008-2011 Freescale Semiconductor, Inc. +*/ + +#ifndef CAAM_COMPAT_H +#define CAAM_COMPAT_H + +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/mod_devicetable.h> +#include <linux/device.h> +#include <linux/interrupt.h> +#include <linux/crypto.h> +#include <linux/hw_random.h> +#include <linux/of_platform.h> +#include <linux/dma-mapping.h> +#include <linux/io.h> +#include <linux/spinlock.h> +#include <linux/rtnetlink.h> +#include <linux/in.h> +#include <linux/slab.h> +#include <linux/types.h> +#include <linux/debugfs.h> +#include <linux/circ_buf.h> +#include <net/xfrm.h> + +#include <crypto/algapi.h> +#include <crypto/aes.h> +#include <crypto/des.h> +#include <crypto/sha.h> +#include <crypto/aead.h> +#include <crypto/authenc.h> +#include <crypto/scatterwalk.h> + +#endif /* !defined(CAAM_COMPAT_H) */
drivers/crypto/caam/ctrl.c new file +270 -0
270 lines not on this page · raw message
drivers/crypto/caam/desc_constr.h new file +204 -0
204 lines not on this page · raw message
drivers/crypto/caam/error.c new file +248 -0
248 lines not on this page · raw message
drivers/crypto/caam/error.h new file +10 -0
@@ -0,0 +1,10 @@ +/* +* CAAM Error Reporting code header +* +* Copyright 2009-2011 Freescale Semiconductor, Inc. +*/ + +#ifndef CAAM_ERROR_H +#define CAAM_ERROR_H +extern char *caam_jr_strstatus (char *outstr,u32 status); +#endif /* CAAM_ERROR_H */
drivers/crypto/caam/intern.h new file +113 -0
113 lines not on this page · raw message
drivers/crypto/caam/jr.c new file +523 -0
523 lines not on this page · raw message
drivers/crypto/caam/jr.h new file +21 -0
@@ -0,0 +1,21 @@ +/* +* CAAM public-level include definitions for the JobR backend +* +* Copyright 2008-2011 Freescale Semiconductor, Inc. +*/ + +#ifndef JR_H +#define JR_H + +/* Prototypes for backend-level services exposed to APIs */ +int caam_jr_register (struct device *ctrldev,struct device **rdev); +int caam_jr_deregister (struct device *rdev); +int caam_jr_enqueue (struct device *dev,u32 *desc, +void (*cbk)(struct device *dev,u32 *desc,u32 status, +void *areq), +void *areq); + +extern int caam_jr_probe (struct platform_device *pdev,struct device_node *np, +int ring); +extern int caam_jr_shutdown (struct device *dev); +#endif /* JR_H */
Signature · 1 line
1.7.4.1