Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp5547466rwb; Wed, 17 Aug 2022 21:04:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR6wA6qeQIvZV7o87JstK8ezd4G/yHnq+sP5VwBp/Kqa6yBn5G3xHNJ+nYZaGxxFtTTtoKeq X-Received: by 2002:a17:902:6b0c:b0:171:325a:364e with SMTP id o12-20020a1709026b0c00b00171325a364emr1265806plk.150.1660795442007; Wed, 17 Aug 2022 21:04:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660795442; cv=none; d=google.com; s=arc-20160816; b=H17ciQuUH39ghKKv7XSDb0Fno6DxQ7O8WbOF/qc72t7wz78grl6MJ9vL1HFRY9awKR 8kW4SHoBfvs4tswZ+eHFlDVcZHkrlubbP9EVZB/FfQhAaXLJgO37itCKIK1q6wr/bDqB 9FwidKiQ3sW9uieWC4jm29MAaJkhd2vhH43IoP109XbW1BHaBCGgBY8xImb9LBfxGs+0 E4A35KL4p+kyNQrFJXI9VwjNxgWcmwOEWMdAXhAmSC+vyYAvtq+c02A23Su2MLp8hxeZ dKxKv1xNSo1UDWr252ISFNesw6DkSIhmlsgLpE67LmISylRkV+96LszFtl9pcqCNYgAx L2hA== 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=6R0cku85KyPxDam9Z8tZaAFc7JhGvl28IXAwyd52B0E=; b=EL++p0pW3eQLfoIYGk7Y34bnOrJZmq8avtrNF779iI9ga48YL6d9b3Ce+dHuJSIBcp GoIV2hAqTdrTkOnEM+/VPf0WKdMfWRRGJeHGlMRmQ1/J0lckS9t5r2tUMXV5WCqsDwig 8np+lWfWVk1deDARFtpxTgTmvPnHF49xNPsMcczwv2VSPUS0uAZJdINLsnoB0ytENaEH 67gZsRi0uzkYHAuCtn+FSgS6m3Z8OJhBcI9GZRgEVGf0kOeEKP6XC4O9b1Kdj+CTgze9 kFs7xy4RZJx17fqBzj9K2Q0pZfsx/cxncc5LAAiX6pOhUdpWaqtvtrH52K8NgGf4g41X 6xew== 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 k71-20020a63844a000000b0041ba9bc9bdfsi549994pgd.16.2022.08.17.21.03.46; Wed, 17 Aug 2022 21:04:01 -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 S242976AbiHREB0 (ORCPT + 99 others); Thu, 18 Aug 2022 00:01:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238762AbiHREBX (ORCPT ); Thu, 18 Aug 2022 00:01:23 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F374AA99F3; Wed, 17 Aug 2022 21:01:21 -0700 (PDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 27I3f8pl089911; Thu, 18 Aug 2022 11:41:08 +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; Thu, 18 Aug 2022 11:59:59 +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 v10 0/5] Add Aspeed crypto driver for hardware acceleration Date: Thu, 18 Aug 2022 11:59:51 +0800 Message-ID: <20220818035956.1160585-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 27I3f8pl089911 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 v9: - Fix unnecessary "goto xxx". Change since v8: - Remove __weak functions for register/unregister crypto algos. - Add missing functions of unregister crypto algos. - Use single debug config to control debug messages. Change since v7: - Define debug Kconfigs. - Simplify assign iv/ivsize. - Simplify cra_init() for hmac related init. Change since v6: - Refine debug print. - Change aspeed_sg_list struct memeber's type to __le32. 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 | 49 + drivers/crypto/aspeed/Makefile | 9 + drivers/crypto/aspeed/aspeed-hace-crypto.c | 1135 ++++++++++++++ drivers/crypto/aspeed/aspeed-hace-hash.c | 1389 +++++++++++++++++ drivers/crypto/aspeed/aspeed-hace.c | 288 ++++ drivers/crypto/aspeed/aspeed-hace.h | 298 ++++ include/dt-bindings/clock/aspeed-clock.h | 1 + include/dt-bindings/clock/ast2600-clock.h | 1 + 14 files changed, 3248 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