From patchwork Mon Jun 24 23:21:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 13710241 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 7F74EC2BD09 for ; Mon, 24 Jun 2024 23:23:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=r6HG+iwKVHbZqxKZKyxVprHzGUJVNgUhomkoXObe400=; b=M+ZwS/ZkSwZ8kyKaRqBy5zd52W Xad8siduCO7J9yb0yoW1FOmcDJ166od3vg2kuyGgsKwyI03OHSBIv38iIE+PVIYwyie2Q3ppRz87w QbxAZ05UR4Rc1x0G2WJ+Cm3XYMBK7uIg5fUveDd2LE4MazfcHgfA0ULheLoENb0kyTYjYgs7gvYlM dEYfhTT1mXdrflMVPJZbPA79E4zWEYZ/em6jz59scA6AGUzgWGpx+/vfVrW2AyQRUrU2+7jeEFk6T wARr/acdfvRoKgZG16abCjwzFNKKC+JEx5sGxCXrJSQ4Jwz2M6C+TYt4xCMXLM2wTYtj+LbhxkJ0T C7vu3zMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLt1f-00000000woI-1BLl; Mon, 24 Jun 2024 23:23:07 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLt1W-00000000wlr-04Oi for linux-arm-kernel@lists.infradead.org; Mon, 24 Jun 2024 23:23:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 565C8339; Mon, 24 Jun 2024 16:23:20 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 760F33F766; Mon, 24 Jun 2024 16:22:53 -0700 (PDT) From: Andre Przywara To: Corentin Labbe , Herbert Xu , "David S . Miller" , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Ryan Walklin , Philippe Simons , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org Subject: [PATCH v2 0/4] crypto: sun8i-ce: add Allwinner H616 support Date: Tue, 25 Jun 2024 00:21:06 +0100 Message-Id: <20240624232110.9817-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.39.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240624_162258_136239_0E56CC3A X-CRM114-Status: GOOD ( 15.10 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is an update to the H616 crypto engine support, with the sparse warning fixed and the accrued tags added. ======================== This series adds support for the crypto engine in the Allwinner H616 SoC. The IP and its capabilities are very similar to the H6, with the major difference of the DMA engine supporting 34 bit wide addresses. This is achieved by just shifting every address by 2 bits in the DMA descriptors; Allwinner calls this "word addresses". Patch 2/4 adds support for this by wrapping every address access in a function that does the shift as needed. Patch 1/4 adds the new compatible string to the binding, patch 3/4 adds that string to the driver and enables the address shift for it. The final patch 4/4 adds the DT node to the SoC .dtsi. Since this is an internal peripheral, it's always enabled. Corentin's cryptotest passed for me, though I haven't checked how fast it is and if it really brings an advantage performance-wise, but maybe people find it useful to offload that from the CPU cores. One immediate advantage is the availability of the TRNG device, which helps to feed the kernel's entropy pool much faster - typically before we reach userland. Without the driver this sometimes takes minutes, and delays workloads that rely on the entropy pool. Please have a look and comment! Cheers, Andre Changelog v1 ... v2: - fix sparse warning by treating writel() call differently (2/4) - add Acks, R-b and Tested-by: tags Andre Przywara (4): dt-bindings: crypto: sun8i-ce: Add compatible for H616 crypto: sun8i-ce - wrap accesses to descriptor address fields crypto: sun8i-ce - add Allwinner H616 support arm64: dts: allwinner: h616: add crypto engine node .../bindings/crypto/allwinner,sun8i-ce.yaml | 2 ++ .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 10 +++++++ .../allwinner/sun8i-ce/sun8i-ce-cipher.c | 8 +++--- .../crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 28 ++++++++++++++++++- .../crypto/allwinner/sun8i-ce/sun8i-ce-hash.c | 6 ++-- .../crypto/allwinner/sun8i-ce/sun8i-ce-prng.c | 6 ++-- .../crypto/allwinner/sun8i-ce/sun8i-ce-trng.c | 2 +- drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 15 ++++++++++ 8 files changed, 65 insertions(+), 12 deletions(-)