From 10c402ef6918d5fc9b1e07f9e98007af69e4e042 Mon Sep 17 00:00:00 2001
From: "Winston Hudson (b45308)" <winston.h.hudson@freescale.com>
Date: Wed, 26 Jun 2013 20:49:36 -0700
Subject: [PATCH] MLK-9769-17 Add AES-ECB support for CAAM in i.MX6 family

Adds AES-ECB (Electronic Codebook) support to the CAAM crypto accelerator core in
the i.MX6 family of SoC devices.

Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families (such as QorIQ).
Thus the property names are often tied to the sec-4.0+ nomenclature.

Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
---
 drivers/crypto/caam/caamalg.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index 737d131cd9d6b7..a7bfe0e6f06420 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -1829,6 +1829,22 @@ static struct caam_alg_template driver_algs[] = {
 			},
 		.class1_alg_type = OP_ALG_ALGSEL_AES | OP_ALG_AAI_CBC,
 	},
+	{
+		.name = "ecb(aes)",
+		.driver_name = "ecb-aes-caam",
+		.blocksize = AES_BLOCK_SIZE,
+		.type = CRYPTO_ALG_TYPE_ABLKCIPHER,
+		.template_ablkcipher = {
+			.setkey = ablkcipher_setkey,
+			.encrypt = ablkcipher_encrypt,
+			.decrypt = ablkcipher_decrypt,
+			.geniv = "eseqiv",
+			.min_keysize = AES_MIN_KEY_SIZE,
+			.max_keysize = AES_MAX_KEY_SIZE,
+			.ivsize = AES_BLOCK_SIZE,
+			},
+		.class1_alg_type = OP_ALG_ALGSEL_AES | OP_ALG_AAI_ECB,
+	},
 	{
 		.name = "cbc(des3_ede)",
 		.driver_name = "cbc-3des-caam",
-- 
GitLab