Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp198769iog; Fri, 24 Jun 2022 02:12:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sbs1cg/GVyjlVkna9hxpvY8GPZO4BBeKDAdqOxKcrNZmdIIs8qZGtDF1VomznS23I0is/Q X-Received: by 2002:aa7:dbd7:0:b0:433:55a6:e3c4 with SMTP id v23-20020aa7dbd7000000b0043355a6e3c4mr16326899edt.74.1656061966313; Fri, 24 Jun 2022 02:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656061966; cv=none; d=google.com; s=arc-20160816; b=KiafMCZFx2vXwnHDDlSFSi+IZ04wKQilystr/O5HtlHExPfxq6BsH4BbvE3dWxv9eT hxrrbjIz6v6zIxaCsAOl79YhqNafYM8mKH/drxyT5uXwNwpaa0R4PQTsO5/xdZM4KPDq IeXv8xrq5/exOlPkMDTa0ZT5xqrmvkvxBOYWLmuNbEIAwZIBeXInkW8sXpbagISwOAOa eSqKS8o5nl8yGKq829O3bA0MyOiead7IlbXHstG4/Am6hfVxsy/7jAlAk8lhcCax12mg YO6jjMRI5WgkZCbAm1RDngWsDiheUZG/dO8lOtXUPqp3T6S7a81gt7SvCSrSlw+i2Uut Ustg== 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=cJB+s6yzttrtv3slMkAlce72knh6BX5IrEseItL/dTE=; b=xk05j+oTxwvYcfjbVta4DKCR86yz7N/isH00hMAtZ03Sp+9/ONCb/jSvyvZLJHuzwg /yuF8zzA838sjyctMqKupeQzr0uTh0rpTmQpZ0l1cekgFaFI58IBPpUaYYSXL2l7eSY7 ZuFeivscdJI8NiCIn23DqU2LtbNjlqiuBhbgsO7s0g6fNJpltFsk/+R8RB/sgbw/ND7v h5NrCFXMDJRE4XHnvQb8xKkwxQm2xMvAjd7v5MbH8OJJBqcOf6/SsW2HPZyOoNrZF7Fa cb2lLpsOeJ7XLsKii9po0fOxAF++9gQXVoZhOkH10bgNro8BhqUEdpdCGHhA5ciMbr47 zExQ== 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 hf10-20020a1709072c4a00b006e0f9bb12a5si1734489ejc.253.2022.06.24.02.12.18; Fri, 24 Jun 2022 02:12:46 -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 S231384AbiFXJKI (ORCPT + 99 others); Fri, 24 Jun 2022 05:10:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230185AbiFXJKE (ORCPT ); Fri, 24 Jun 2022 05:10:04 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 454AE4F1DE; Fri, 24 Jun 2022 02:10:02 -0700 (PDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 25O8qkU0088205; Fri, 24 Jun 2022 16:52:46 +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, 24 Jun 2022 17:08:30 +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 v4 0/5] Add Aspeed crypto driver for hardware acceleration Date: Fri, 24 Jun 2022 17:08:22 +0800 Message-ID: <20220624090827.3909179-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 25O8qkU0088205 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. 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 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 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-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 | 1041 ++++++++++++ drivers/crypto/aspeed/aspeed-hace-hash.c | 1428 +++++++++++++++++ drivers/crypto/aspeed/aspeed-hace.c | 301 ++++ drivers/crypto/aspeed/aspeed-hace.h | 289 ++++ include/dt-bindings/clock/ast2600-clock.h | 1 + 12 files changed, 3178 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