Skip to contentSkip to conversation

crypto: added support for fsl-dcp on iMX23,28,50

PATCH New Christoph G. Baumann 1 participant 3 messages Apr 26, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover crypto: added support for fsl-dcp on iMX23,28,50

From: "Christoph G. Baumann" <[email protected]>

This patch is based on the original driver by Freescale.
The driver gives access to the DCP crypto core which can accelerate AES and SHA operations.
It was ported to the current API and sanitized to please checkpatch.pl.

Christoph G. Baumann (2):
crypto: added support for fsl-dcp on iMX23,28,50
crypto: added support for fsl-dcp on iMX23,28,50

 arch/arm/boot/dts/imx28.dtsi                 |    2 +-
 drivers/staging/Kconfig                      |    2 +
 drivers/staging/Makefile                     |    1 +
 drivers/staging/crypto/Kconfig               |   15 +
 drivers/staging/crypto/Makefile              |    1 +
 drivers/staging/crypto/fsl-dcp.c             | 1790 ++++++++++++++++++++++++++
 drivers/staging/crypto/fsl-dcp.h             |  739 +++++++++++
 include/linux/fsl/fsl-dcp_bootstream_ioctl.h |   32 +
 8 files changed, 2581 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/crypto/Kconfig
 create mode 100644 drivers/staging/crypto/Makefile
 create mode 100644 drivers/staging/crypto/fsl-dcp.c
 create mode 100644 drivers/staging/crypto/fsl-dcp.h
 create mode 100644 include/linux/fsl/fsl-dcp_bootstream_ioctl.h
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/2 crypto: added support for fsl-dcp on iMX23,28,50

From: "Christoph G. Baumann" <[email protected]>

This patch contains added files

---
 drivers/staging/crypto/Kconfig               |   15 +
 drivers/staging/crypto/Makefile              |    1 +
 drivers/staging/crypto/fsl-dcp.c             | 1790 ++++++++++++++++++++++++++
 drivers/staging/crypto/fsl-dcp.h             |  739 +++++++++++
 include/linux/fsl/fsl-dcp_bootstream_ioctl.h |   32 +
 5 files changed, 2577 insertions(+)
 create mode 100644 drivers/staging/crypto/Kconfig
 create mode 100644 drivers/staging/crypto/Makefile
 create mode 100644 drivers/staging/crypto/fsl-dcp.c
 create mode 100644 drivers/staging/crypto/fsl-dcp.h
 create mode 100644 include/linux/fsl/fsl-dcp_bootstream_ioctl.h
drivers/staging/crypto/Kconfig new file +15 -0
new file mode 100644
index 0000000..acf2cf9
@@ -0,0 +1,15 @@
+config CRYPTO_DEV_FSL_DCP
+	tristate "Support for the DCP engine"
+	depends on SOC_IMX23 || SOC_IMX28 || SOC_IMX50
+  select CRYPTO_HW
+	select CRYPTO_ALGAPI
+  select CRYPTO_SHA256
+	select CRYPTO_AES
+	select CRYPTO_BLKCIPHER
+	help
+	  Say 'Y' here to use the DCP AES and SHA
+	  engine for the CryptoAPI algorithms.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called fsl-dcp.
+
drivers/staging/crypto/Makefile new file +1 -0
new file mode 100644
index 0000000..06eabdf
@@ -0,0 +1 @@
+obj-$(CONFIG_CRYPTO_DEV_FSL_DCP) += fsl-dcp.o
drivers/staging/crypto/fsl-dcp.c new file +1790 -0

1,790 lines not on this page · raw message

drivers/staging/crypto/fsl-dcp.h new file +739 -0

739 lines not on this page · raw message

include/linux/fsl/fsl-dcp_bootstream_ioctl.h new file +32 -0
new file mode 100644
index 0000000..2859a8d
@@ -0,0 +1,32 @@
+/*
+ * Freescale DCP driver for bootstream update. Only handles the OTP KEY
+ * case and can only encrypt/decrypt.
+ *
+ * Author: Pantelis Antoniou <[email protected]>
+ *
+ * Copyright (C) 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
+ */
+
+/*
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+#ifndef DCP_BOOTSTREAM_IOCTL_H
+#define DCP_BOOTSTREAM_IOCTL_H
+
+/* remember to have included the proper _IO definition
+ * file before hand.
+ * For user space it's <sys/ioctl.h>
+ */
+
+#define DBS_IOCTL_BASE   'd'
+
+#define DBS_ENC _IOW(DBS_IOCTL_BASE, 0x00, uint8_t[16])
+#define DBS_DEC _IOW(DBS_IOCTL_BASE, 0x01, uint8_t[16])
+
+#endif
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/2 crypto: added support for fsl-dcp on iMX23,28,50

In reply to Christoph G. Baumann

From: "Christoph G. Baumann" <[email protected]>

This patch contains modified files.

---
 arch/arm/boot/dts/imx28.dtsi |    2 +-
 drivers/staging/Kconfig      |    2 ++
 drivers/staging/Makefile     |    1 +
 3 files changed, 4 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx28.dtsi +1 -1
index 7ba4966..2bec573 100644
@@ -664,9 +664,9 @@
 			};
 
 			dcp at 80028000 {
+                                compatible = "fsl,fsl-dcp";
 				reg = <0x80028000 0x2000>;
 				interrupts = <52 53 54>;
-				status = "disabled";
 			};
 
 			pxp at 8002a000 {
drivers/staging/Kconfig +2 -0
index 093f10c..b3cf08b 100644
@@ -140,4 +140,6 @@ source "drivers/staging/zcache/Kconfig"
 
 source "drivers/staging/goldfish/Kconfig"
 
+source "drivers/staging/crypto/Kconfig"
+
 endif # STAGING
drivers/staging/Makefile +1 -0
index fa41b04..6875e3e 100644
@@ -62,3 +62,4 @@ obj-$(CONFIG_SB105X)		+= sb105x/
 obj-$(CONFIG_FIREWIRE_SERIAL)	+= fwserial/
 obj-$(CONFIG_ZCACHE)		+= zcache/
 obj-$(CONFIG_GOLDFISH)		+= goldfish/
+obj-$(CONFIG_CRYPTO_HW)		+= crypto/
Signature · 1 line
1.7.9.5