From patchwork Mon Mar 13 13:56:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia Jie Ho X-Patchwork-Id: 13172573 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4BFFAC7618B for ; Mon, 13 Mar 2023 13:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :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=Z5zvBG0q+4BEm9NBa/v3gTyJIOkZmytFM9SfCzInrpQ=; b=rFOhxQWC0hYqb7 i89kdnj/JvV9B4nuHJWxhaZtJyQoVj3RQcPcxTIhIro8/WFruqrsEdi5QI4G9JD6UHB6wymDRRE5b CnzJ/qy34IafxVV8gaT1HFAUwaNvKJZaRA/VBWtAoqOS8pNI/bgOMZ2fcnlthTfqUUl4nhDjBAzQV XCHuC5WK0TbnMh5fJwbNMrZ8RkUeHRyR8rV4jVNwbn2GRJykzgVmoFVrm5G8idgVHAsHUjqOw8H76 BOd/qiRf42eTHmp7LC5c+3GQrAAWZznrANUYf5k7ne1TLwXbMwFXYoaB81em0EJmqapB3t38XXak4 mRxZa70F+laITXxjom5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbihC-0061H6-45; Mon, 13 Mar 2023 13:58:39 +0000 Received: from ex01.ufhost.com ([61.152.239.75]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbih6-00617m-Ip for linux-riscv@lists.infradead.org; Mon, 13 Mar 2023 13:58:35 +0000 Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id DDF9A24DBCE; Mon, 13 Mar 2023 21:57:32 +0800 (CST) Received: from EXMBX068.cuchost.com (172.16.6.68) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 13 Mar 2023 21:57:32 +0800 Received: from ubuntu.localdomain (202.190.105.77) by EXMBX068.cuchost.com (172.16.6.68) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 13 Mar 2023 21:57:12 +0800 From: Jia Jie Ho To: Herbert Xu , "David S . Miller" , Rob Herring , Krzysztof Kozlowski , Emil Renner Berthing , Conor Dooley CC: , , , Subject: [PATCH v3 0/4] crypto: starfive - Add drivers for crypto engine Date: Mon, 13 Mar 2023 21:56:42 +0800 Message-ID: <20230313135646.2077707-1-jiajie.ho@starfivetech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [202.190.105.77] X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) To EXMBX068.cuchost.com (172.16.6.68) X-YovoleRuleAgent: yovoleflag X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230313_065832_993339_4610B87B X-CRM114-Status: GOOD ( 13.83 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This patch series adds kernel driver support for StarFive JH7110 crypto engine. The first patch adds Documentations for the device and Patch 2 adds device probe and DMA init for the module. Patch 3 adds crypto and DMA dts node for VisionFive 2 board. Patch 4 adds hash/hmac support to the module. Patch 3 needs to be applied on top of: https://patchwork.kernel.org/project/linux-riscv/patch/20230221024645.127922-18-hal.feng@starfivetech.com/ https://patchwork.kernel.org/project/linux-riscv/cover/20230120024445.244345-1-xingyu.wu@starfivetech.com/ Changes v2->v3: - Only implement digest and use fallback for other ops (Herbert) - Use interrupt instead of polling for hash complete (Herbert) - Remove manual data copy from out-of-bound memory location as it will be handled by DMA API. (Christoph & Herbert) Changes v1->v2: - Fixed yaml filename and format (Krzysztof) - Removed unnecessary property names in yaml (Krzysztof) - Moved of_device_id table close to usage (Krzysztof) - Use dev_err_probe for error returns (Krzysztof) - Dropped redundant readl and writel wrappers (Krzysztof) - Updated commit signed offs (Conor) - Dropped redundant node in dts, module set to on in dtsi (Conor) Jia Jie Ho (4): dt-bindings: crypto: Add StarFive crypto module crypto: starfive - Add crypto engine support riscv: dts: starfive: Add crypto and DMA node for VisionFive 2 crypto: starfive - Add hash and HMAC support .../crypto/starfive,jh7110-crypto.yaml | 70 ++ MAINTAINERS | 7 + arch/riscv/boot/dts/starfive/jh7110.dtsi | 28 + drivers/crypto/Kconfig | 1 + drivers/crypto/Makefile | 1 + drivers/crypto/starfive/Kconfig | 21 + drivers/crypto/starfive/Makefile | 4 + drivers/crypto/starfive/jh7110-cryp.c | 239 ++++ drivers/crypto/starfive/jh7110-cryp.h | 134 +++ drivers/crypto/starfive/jh7110-hash.c | 1041 +++++++++++++++++ 10 files changed, 1546 insertions(+) create mode 100644 Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml create mode 100644 drivers/crypto/starfive/Kconfig create mode 100644 drivers/crypto/starfive/Makefile create mode 100644 drivers/crypto/starfive/jh7110-cryp.c create mode 100644 drivers/crypto/starfive/jh7110-cryp.h create mode 100644 drivers/crypto/starfive/jh7110-hash.c