Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp198739imn; Fri, 29 Jul 2022 04:30:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR5stH/gpn6exF8+99XxA7kPQO/3cG3rz9Nl81t2tCGR8LwGiKnyEYLcxtZASvOyFzro6LKF X-Received: by 2002:a17:902:e78f:b0:16c:8741:fea1 with SMTP id cp15-20020a170902e78f00b0016c8741fea1mr3414076plb.89.1659094203239; Fri, 29 Jul 2022 04:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659094203; cv=none; d=google.com; s=arc-20160816; b=v8V7vjRGD1jiko22X8asYo0KnwcOZudW+/7A6JbGMb04kKXt+DO1B6gITPVy6bhDaW iTNva+Ox4cT7RTU79kaog/qN+hUF/MD24mTywR2nGU/HWCbcAS7GnfHMePaNT/SBiPRn U8ylhqqhJRnlsFxs3YtnWm3KT4pMrnuAovLda4oaMazizGTTMKo9Hd4k1S5MvuQ08k0g oQmij0oEddTogfwD7Rn7HDPPNaC1gC6+YKhK+avtDkz5GCUB1VQffRFD1qoC/Fddmv+f 3XluLuyZmRJ5tVv/lpcMsvRUZIXPLQ+Vgnmol+Y/SkTsZc2F3ZvY8rKzBDoo6VGlAJ0h HeVg== 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=ORo4zrLYPRBOb3LLxuRn3vCckzfJVC/1WsC5tUd6fEA=; b=S41UXyft3hQ7l4TMrcoB7/HDA4Y/TLffbNkwUiLgBWFJgXNMhmSRGjVEFJZ4np7ezW SjDmOVjVY/lq2vmz6DEGjefYudE1OfTPzNtQ45NaMuGRxam5QHLtjTkP+8LyFAiWwrl7 KtFxjUPMA7UzmF7vGfoiX+kbmNDry7XYG3D5H14Z4yhdfsP5pBz0WK+xPGhPM5BHuO6a Lp5lTo8GBzGzsBNo/mq4OHHRYiI7yjwYCURXZY6prkA3RN2PEkcB7Np818C2e87lMIiR +vmwm7lqi/bV4wDnFXBfdx7hrI3irAY8aOKBAzhx3wvvgKkJBl99FIM5kXp8FsRpBDYN Zb+g== 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 144-20020a621696000000b0052c79a96579si3248191pfw.360.2022.07.29.04.29.48; Fri, 29 Jul 2022 04:30:03 -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 S232387AbiG2LY5 (ORCPT + 99 others); Fri, 29 Jul 2022 07:24:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235979AbiG2LY4 (ORCPT ); Fri, 29 Jul 2022 07:24:56 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCAF33DF3C; Fri, 29 Jul 2022 04:24:52 -0700 (PDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 26TB5WpT050856; Fri, 29 Jul 2022 19:05:32 +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; Fri, 29 Jul 2022 19:23:16 +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 v9 0/5] Add Aspeed crypto driver for hardware acceleration Date: Fri, 29 Jul 2022 19:23:08 +0800 Message-ID: <20220729112313.86169-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 26TB5WpT050856 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 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