Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp410539iog; Wed, 29 Jun 2022 02:49:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tQ/HPtjJ7DrG/1becDOcUes73OWMJxpywnlBzD41Zr5hta4K2ZomusjtR+BIBtOcru9VGj X-Received: by 2002:a05:6402:3304:b0:437:74dc:b6ea with SMTP id e4-20020a056402330400b0043774dcb6eamr3093932eda.141.1656496150997; Wed, 29 Jun 2022 02:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656496150; cv=none; d=google.com; s=arc-20160816; b=ZtW+CvCuR8HLMnIZuniA6YZjZh84CW4wDT7qHcNorPkpmKLjiLdmkF2L1afrEb9cUy ngzZHUIR+6bbCBn0YiuTqkju2dG1UpCC0wsUvC5i5H2n7Z8iqO3Q3KH4vvZ2ScKsrEUy PtXDfbmr4YezhV88U+471Vrbh4F6COycqmf6YuuwrTwxfo/jCgllJBV5rW+mLdi190jU PHYx+Y5DfLVc6atMuIhUgIFHud5J7Yjif5iMpxJcFPztetajvwaSn2eZmSEd8G/2vTIh i3+dg4d5eEn/0a9j+rkVtogWygv7Jr25ouI2pBWCfRgf0jx/9IquhGrtVf6CJhGYUide FdkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=5OoSN/krAkWr3sBG3hCINSAqZby+9IPOwB1188JgQ3M=; b=utBGxKxP/TJ2i39ZDL/q5NxVk6MNvS37efZWeWC5FS+oolft6R/6TshARfnm8lRX3x 30kTDikhPmMw8L/0JDe40f5o0urynBMQNv5AahrEU9jEjxRrctJUQAcYnPsIpLcXon7h ITjelhkTvYt0qWfWrkNd4E7SqJT6SdqRmg3/vb9M7TSaiuJSUI28U8KWSLy6StN0yAo9 WGVyQIv6aL4eHGU3dY+r/TCEZT0D5A/b/B98y6D1O5z/ydx4dOuI185kguP4zAP6NrZq jRkhZy45a4N20NeVsv3YrCwPo3l8kBZ4+WZar8FdzEEFl+JdDOdhtrHoETWOJDs3HXCX uiWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ly9-20020a170906af4900b00715849159ebsi16664883ejb.144.2022.06.29.02.48.45; Wed, 29 Jun 2022 02:49:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233090AbiF2Jph (ORCPT + 99 others); Wed, 29 Jun 2022 05:45:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233079AbiF2Jpf (ORCPT ); Wed, 29 Jun 2022 05:45:35 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 427023BBC8; Wed, 29 Jun 2022 02:45:34 -0700 (PDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 25T9SRxn051154; Wed, 29 Jun 2022 17:28:27 +0800 (GMT-8) (envelope-from neal_liu@aspeedtech.com) Received: from localhost.localdomain (192.168.10.10) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 29 Jun 2022 17:44:31 +0800 From: Neal Liu To: Corentin Labbe , Christophe JAILLET , Randy Dunlap , Herbert Xu , "David S . Miller" , Rob Herring , Krzysztof Kozlowski , Joel Stanley , "Andrew Jeffery" , Dhananjay Phadke , "Johnny Huang" CC: , , , , , Subject: [PATCH v6 0/5] Add Aspeed crypto driver for hardware acceleration Date: Wed, 29 Jun 2022 17:44:21 +0800 Message-ID: <20220629094426.1930589-1-neal_liu@aspeedtech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.10.10] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 25T9SRxn051154 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Aspeed Hash and Crypto Engine (HACE) is designed to accelerate the throughput of hash data digest, encryption and decryption. These patches aim to add Aspeed hash & crypto driver support. The hash & crypto driver also pass the run-time self tests that take place at algorithm registration. The patch series are tested on both AST2500 & AST2600 evaluation boards. Tested-by below configs: - CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set - CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y - CONFIG_DMA_API_DEBUG=y - CONFIG_DMA_API_DEBUG_SG=y - CONFIG_CPU_BIG_ENDIAN=y Change since v5: - Re-define HACE clock define to fix breaking ABI. Change since v4: - Add AST2500 clock definition & dts node. - Add software fallback for handling corner cases. - Fix copy wrong key length. Change since v3: - Use dmam_alloc_coherent() instead to manage dma_alloc_coherent(). - Add more error handler of dma_prepare() & crypto_engine_start(). Change since v2: - Fix endianness issue. Tested on both little endian & big endian system. - Use common crypto hardware engine for enqueue & dequeue requests. - Use pre-defined IVs for SHA-family. - Revise error handler flow. - Fix sorts of coding style problems. Change since v1: - Add more error handlers, including DMA memory allocate/free, DMA map/unmap, clock enable/disable, etc. - Fix check dma_map error for config DMA_API_DEBUG. - Fix dt-binding doc & dts node naming. Neal Liu (5): crypto: aspeed: Add HACE hash driver dt-bindings: clock: Add AST2500/AST2600 HACE reset definition ARM: dts: aspeed: Add HACE device controller node dt-bindings: crypto: add documentation for aspeed hace crypto: aspeed: add HACE crypto driver .../bindings/crypto/aspeed,ast2500-hace.yaml | 53 + MAINTAINERS | 7 + arch/arm/boot/dts/aspeed-g5.dtsi | 8 + arch/arm/boot/dts/aspeed-g6.dtsi | 8 + drivers/crypto/Kconfig | 1 + drivers/crypto/Makefile | 1 + drivers/crypto/aspeed/Kconfig | 40 + drivers/crypto/aspeed/Makefile | 8 + drivers/crypto/aspeed/aspeed-hace-crypto.c | 1122 +++++++++++++ drivers/crypto/aspeed/aspeed-hace-hash.c | 1428 +++++++++++++++++ drivers/crypto/aspeed/aspeed-hace.c | 301 ++++ drivers/crypto/aspeed/aspeed-hace.h | 293 ++++ include/dt-bindings/clock/aspeed-clock.h | 1 + include/dt-bindings/clock/ast2600-clock.h | 1 + 14 files changed, 3272 insertions(+) create mode 100644 Documentation/devicetree/bindings/crypto/aspeed,ast2500-hace.yaml create mode 100644 drivers/crypto/aspeed/Kconfig create mode 100644 drivers/crypto/aspeed/Makefile create mode 100644 drivers/crypto/aspeed/aspeed-hace-crypto.c create mode 100644 drivers/crypto/aspeed/aspeed-hace-hash.c create mode 100644 drivers/crypto/aspeed/aspeed-hace.c create mode 100644 drivers/crypto/aspeed/aspeed-hace.h -- 2.25.1