From patchwork Wed Sep 12 08:59:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Horia Geanta X-Patchwork-Id: 10597139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF105112B for ; Wed, 12 Sep 2018 09:03:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB0592944D for ; Wed, 12 Sep 2018 09:03:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEE7F294E2; Wed, 12 Sep 2018 09:03:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 086D72944D for ; Wed, 12 Sep 2018 09:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sh8yHoeYlonBz2YM+5YTLj3Iz5ALiXnQ1gfMTveATVM=; b=JagR1DMpTBrN2e MDp1EKNQsM+xkzsP/L13mlU4AXjhpce60ZTGMtEp3TMRoEEdDHmzdLQnhhzflzQr5BlG7KTR7mQrL RIcbf+aVL/ARyoguPb/rFxHgQXxJrq5V9YloDKqpMzhtpqH2FxXvzpw64NNmdq8wcrSCx+oYIwr/h m+Mx71hKtjMbNZRU6lWgmucJZ/0cDg0BIqA2abrTTQ88BLen/avh3C793RR4kPwQR2ty0iSGJbZaH KCvc8IZU7301OmoIRgwlDvXpmDPcjHvm0wJVEMg/KQ1xAJqoEgtCE6TBj51Bi695posV2hyS5pxUW 8gEGAbrXmxTOz7tt/bLg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g012t-0006md-W5; Wed, 12 Sep 2018 09:02:48 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g010J-00041l-Bh for linux-arm-kernel@lists.infradead.org; Wed, 12 Sep 2018 09:00:19 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A0B131A0112; Wed, 12 Sep 2018 10:59:53 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 941A81A0102; Wed, 12 Sep 2018 10:59:53 +0200 (CEST) Received: from enigma.ea.freescale.net (enigma.ea.freescale.net [10.171.81.110]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 149A8205F0; Wed, 12 Sep 2018 10:59:53 +0200 (CEST) From: =?utf-8?q?Horia_Geant=C4=83?= To: Herbert Xu , Stuart Yoder , Laurentiu Tudor , Li Yang , Roy Pledge , Catalin Marinas , Will Deacon Subject: [PATCH v2 00/12] crypto: caam - add DPAA2 (DPSECI) driver Date: Wed, 12 Sep 2018 11:59:25 +0300 Message-Id: <20180912085937.22489-1-horia.geanta@nxp.com> X-Mailer: git-send-email 2.16.2 MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180912_020007_718311_9D6EEFD9 X-CRM114-Status: GOOD ( 13.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Aymen Sghaier , "David S . Miller" , linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, This patch set adds the CAAM crypto engine driver for DPAA2 (Data Path Acceleration Architecture v2) found on ARMv8-based SoCs like LS1088A, LS2088A, LX2160A. v1 -> v2: 5/12 - new patch fixing sparse endianness-related warnings 2/12 - changed commit message, since it's not a straightforward revert 3/12, 8/12, 11/12 - fixed sparse and compiler warnings Previous versions: v1: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1763549.html RFC: https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg27290.html Driver consists of: -DPSECI (Data Path SEC Interface) backend - low-level API that allows to manage DPSECI devices (DPAA2 objects) that sit on the Management Complex (MC) fsl-mc bus -algorithms frontend - AEAD, skcipher and ahash algorithms implementation Patches 1-4 are fsl-mc bus and DPIO dependencies. Stuart, Laurentiu, Leo, Roy, please review the patches and let me know if you have anything against going with them through the cryptodev tree. Patch 5 fixes sparse endianness-related warnings in regs.h helper functions. Patches 6-11 are the core of the patch set, adding the driver. For symmetric encryption the new skcipher interface is used. Patch 12 enables driver on arm64. It will be built only if dependency on DPIO (CONFIG_FSL_MC_DPIO) is satisfied. Note: multiple modprobe/rmmod won't work without the following patches [5/7,v7] bus/fsl-mc: support dma configure for devices on fsl-mc bus https://patchwork.kernel.org/patch/10594179 [7/7,v7] arm64: dts: ls208xa: comply with the iommu map binding for fsl_mc https://patchwork.kernel.org/patch/10594171 (for LS1088A a similar DT update is needed) Thanks, Horia Horia Geantă (12): bus: fsl-mc: add support for dpseci device type soc: fsl: dpio: add back some frame queue functions soc: fsl: dpio: add frame list format support soc: fsl: dpio: add congestion notification support crypto: caam - fix implicit casts in endianness helpers crypto: caam - add DPAA2-CAAM (DPSECI) backend API crypto: caam - add Queue Interface v2 error codes crypto: caam/qi2 - add DPAA2-CAAM driver crypto: caam/qi2 - add skcipher algorithms crypto: caam - export ahash shared descriptor generation crypto: caam/qi2 - add support for ahash algorithms arm64: defconfig: enable CAAM crypto engine on QorIQ DPAA2 SoCs arch/arm64/configs/defconfig | 1 + drivers/bus/fsl-mc/fsl-mc-bus.c | 5 + drivers/crypto/Makefile | 2 +- drivers/crypto/caam/Kconfig | 55 +- drivers/crypto/caam/Makefile | 10 +- drivers/crypto/caam/caamalg_qi2.c | 5165 +++++++++++++++++++++++++++++++++++ drivers/crypto/caam/caamalg_qi2.h | 223 ++ drivers/crypto/caam/caamhash.c | 79 +- drivers/crypto/caam/caamhash_desc.c | 80 + drivers/crypto/caam/caamhash_desc.h | 21 + drivers/crypto/caam/compat.h | 1 + drivers/crypto/caam/dpseci.c | 426 +++ drivers/crypto/caam/dpseci.h | 333 +++ drivers/crypto/caam/dpseci_cmd.h | 149 + drivers/crypto/caam/error.c | 79 +- drivers/crypto/caam/error.h | 6 +- drivers/crypto/caam/regs.h | 30 +- drivers/soc/fsl/dpio/dpio-service.c | 58 + include/linux/fsl/mc.h | 6 + include/soc/fsl/dpaa2-fd.h | 242 ++ include/soc/fsl/dpaa2-global.h | 15 + include/soc/fsl/dpaa2-io.h | 4 + 22 files changed, 6885 insertions(+), 105 deletions(-) create mode 100644 drivers/crypto/caam/caamalg_qi2.c create mode 100644 drivers/crypto/caam/caamalg_qi2.h create mode 100644 drivers/crypto/caam/caamhash_desc.c create mode 100644 drivers/crypto/caam/caamhash_desc.h create mode 100644 drivers/crypto/caam/dpseci.c create mode 100644 drivers/crypto/caam/dpseci.h create mode 100644 drivers/crypto/caam/dpseci_cmd.h