From patchwork Tue Apr 23 12:11:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Christoph G. Baumann" X-Patchwork-Id: 2477321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id E3164DF2E5 for ; Tue, 23 Apr 2013 12:11:37 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUc4L-0002MG-SQ; Tue, 23 Apr 2013 12:11:34 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUc4J-0007FU-7Q; Tue, 23 Apr 2013 12:11:31 +0000 Received: from moutng.kundenserver.de ([212.227.126.171]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUc4F-0007Ek-TZ for linux-arm-kernel@lists.infradead.org; Tue, 23 Apr 2013 12:11:29 +0000 Received: from baumann-laptop.ppc-ag.de ([212.65.29.63]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0Ldsvr-1Uuq450jSd-00j1By; Tue, 23 Apr 2013 14:11:26 +0200 From: "Christoph G. Baumann" To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] Support fsl-dcp crypto coprocessor Date: Tue, 23 Apr 2013 14:11:25 +0200 Message-Id: <1366719085-12847-3-git-send-email-cb@sgoc.de> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1366719085-12847-1-git-send-email-cb@sgoc.de> References: <1366710460-11637-1-git-send-email-cb@sgoc.de> <1366719085-12847-1-git-send-email-cb@sgoc.de> X-Provags-ID: V02:K0:WqGo5E5721oLZY5iqWpBM95Fp6a043p7oIN4Bc4EyN4 jfZwLBa9OEmjc6Nz7qTTzTCmS+3FPFXSnYLDRIR7N58tSpGgkV 3jMyslacE5rxZ5YEK4xJh6Voeli2gDjoLfF6vB2VU/loIpHHr4 4AUxueaAVH3hN4XIkaZLWvPVh6nSzLLxcEYz9NE8c5FIf8rxnJ 17EKXfEqul69mVRQHPFEVp0x+fXZxdVF3hPxDCIAoJ07OAOrWG SjRQ/gEOz6G0ayziRGjTXghs3T11oFe006avGejl3fLFqA4vBQ clYagymyYA9BCcaQqvH3T3W5+EQ3EMcoW8zE0dSZXf8lqGrGDb +wPrI5MKRA93UB9YJiLPXHRiEWH/1ARB8ksL8pWNTjNMFaVYkB s8p2aiIJ4qVuA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130423_081128_174221_E9AFCC1A X-CRM114-Status: GOOD ( 11.90 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.171 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: "Christoph G. Baumann" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: "Christoph G. Baumann" Forgot some changed files in the first try... The following patch is a port of the original driver from Freescale to the current mainline. The patch was tested under 3.7. Signed-off-by: "Christoph G. Baumann" --- arch/arm/boot/dts/imx28.dtsi | 2 +- drivers/staging/Kconfig | 2 ++ drivers/staging/Makefile | 1 + include/linux/fsl/fsl-dcp_bootstream_ioctl.h | 32 ++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 include/linux/fsl/fsl-dcp_bootstream_ioctl.h diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi index 7ba4966..07c80cd 100644 --- a/arch/arm/boot/dts/imx28.dtsi +++ b/arch/arm/boot/dts/imx28.dtsi @@ -664,9 +664,9 @@ }; dcp@80028000 { + compatible = "fsl,fsl-dcp"; reg = <0x80028000 0x2000>; interrupts = <52 53 54>; - status = "disabled"; }; pxp@8002a000 { diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig index 093f10c..b3cf08b 100644 --- a/drivers/staging/Kconfig +++ b/drivers/staging/Kconfig @@ -140,4 +140,6 @@ source "drivers/staging/zcache/Kconfig" source "drivers/staging/goldfish/Kconfig" +source "drivers/staging/crypto/Kconfig" + endif # STAGING diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile index fa41b04..6875e3e 100644 --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile @@ -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/ diff --git a/include/linux/fsl/fsl-dcp_bootstream_ioctl.h b/include/linux/fsl/fsl-dcp_bootstream_ioctl.h new file mode 100644 index 0000000..2859a8d --- /dev/null +++ b/include/linux/fsl/fsl-dcp_bootstream_ioctl.h @@ -0,0 +1,32 @@ +/* + * Freescale DCP driver for bootstream update. Only handles the OTP KEY + * case and can only encrypt/decrypt. + * + * Author: Pantelis Antoniou + * + * 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 + */ + +#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