From patchwork Thu Aug 27 18:00:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Cerveny X-Patchwork-Id: 11741237 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 82CF614E5 for ; Thu, 27 Aug 2020 18:03:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5AC6B2087C for ; Thu, 27 Aug 2020 18:03:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vydlOpvK"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="JeNzQwjo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5AC6B2087C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=computer.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject: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=KVngsypXq/iSl8W5a57a1VC5KK0iIxkXqDcJbiqUJCc=; b=vydlOpvKLEtW1HDaaC5/4OH0ul WFwn2NP6iKU5K41XNkzbPcluSnZuKwihAKYGDWdM/16qN9RAewvi5RpHJPEYpY+CfYY/o7o5qkYS5 LK9O66sNyFnVpF/oFA8ObNlblBFmxW1uFwYO5SCSGwoHiKGd+1TDMAwGI1LvgmWPw6qsLhMuS8YZH 5WUnZ5YO06Nu2ruwFod7L3EeRQDd2e6NwZir2FnrgJ5zXGrygnOSZMOBrAcG9v6cJrYjkJeXJzmdl odaXjUacz/3VMci1+1a6HNeDXsv8Wkk+vPjBgxsfcSLvhysVQvOhoPENDItMo/pWflc+IqF9fuW4Q x0lbXPFw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBMDe-0004Xg-8r; Thu, 27 Aug 2020 18:01:50 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBMDc-0004XW-Op for linux-arm-kernel@merlin.infradead.org; Thu, 27 Aug 2020 18:01:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=dHceg9GlrhNV/fee2WXlTt8bNJOF0/y1+qshqESdLfI=; b=JeNzQwjoyUetSsZRM1I07dyDbU gIKBK6h/nEDodbMqoMFGBANBXHF6kJopgVrSZ/fYOvTtfh5JP0r/mIVqoe5HBuLA8Ud6qEIGh+Fai 8DdJmxQKnXcDcLKwisAqIqJu+30n9Uzfvo6M9+H+hz3t8aTHqIEVff8sx05bowepcX7Q9RBT9mYED 3RAgURgOK5kai9jO3H8EQuIxBGPfDFK3L337XMc7UlAIlDDax0Il2e20aRaYYVtY8dRukFsOAufKS RYHxnRmnaL/lXavZeZR3+H/o9kwL7FQg3FFjbuNIk2oXIe07nQoGRgtVjrHvEd7GJjBbb+mkzaYcM OyS6OHQw==; Received: from gw.c-home.cz ([89.24.150.100] helo=dmz.c-home.cz) by casper.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBMDX-00082l-9d for linux-arm-kernel@lists.infradead.org; Thu, 27 Aug 2020 18:01:47 +0000 Received: from localhost.localdomain (intra-239.c-home.cz [192.168.1.239]) by dmz.c-home.cz (8.14.4+Sun/8.14.4) with ESMTP id 07RI0T1G020164; Thu, 27 Aug 2020 20:00:34 +0200 (CEST) From: Martin Cerveny To: clabbe.montjoie@gmail.com Subject: [PATCH] ARM: dts: sun8i: v3s: Enable crypto engine Date: Thu, 27 Aug 2020 20:00:27 +0200 Message-Id: <20200827180027.6254-1-m.cerveny@computer.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200827_190143_540359_ED26577A X-CRM114-Status: GOOD ( 11.38 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, herbert@gondor.apana.org.au, linux-kernel@vger.kernel.org, mripard@kernel.org, wens@csie.org, robh+dt@kernel.org, linux-crypto@vger.kernel.org, m.cerveny@computer.org, davem@davemloft.net, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org V3S contains crypto engine that is compatible with "sun4i-ss". Tested-by: Martin Cerveny Signed-off-by: Martin Cerveny Acked-by: Corentin Labbe --- .../bindings/crypto/allwinner,sun4i-a10-crypto.yaml | 5 ++++- arch/arm/boot/dts/sun8i-v3s.dtsi | 10 ++++++++++ drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c | 7 +++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/crypto/allwinner,sun4i-a10-crypto.yaml b/Documentation/devicetree/bindings/crypto/allwinner,sun4i-a10-crypto.yaml index fc823572b..180efd13a 100644 --- a/Documentation/devicetree/bindings/crypto/allwinner,sun4i-a10-crypto.yaml +++ b/Documentation/devicetree/bindings/crypto/allwinner,sun4i-a10-crypto.yaml @@ -25,6 +25,7 @@ properties: - const: allwinner,sun4i-a10-crypto - items: - const: allwinner,sun8i-a33-crypto + - const: allwinner,sun8i-v3s-crypto reg: maxItems: 1 @@ -59,7 +60,9 @@ if: properties: compatible: contains: - const: allwinner,sun6i-a31-crypto + oneOf: + - const: allwinner,sun6i-a31-crypto + - const: allwinner,sun8i-v3s-crypto then: required: diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi index e5312869c..4fec84c40 100644 --- a/arch/arm/boot/dts/sun8i-v3s.dtsi +++ b/arch/arm/boot/dts/sun8i-v3s.dtsi @@ -234,6 +234,16 @@ #size-cells = <0>; }; + crypto: crypto@1c15000 { + compatible = "allwinner,sun8i-v3s-crypto"; + reg = <0x01c15000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_CE>, <&ccu CLK_CE>; + clock-names = "ahb", "mod"; + resets = <&ccu RST_BUS_CE>; + reset-names = "ahb"; + }; + usb_otg: usb@1c19000 { compatible = "allwinner,sun8i-h3-musb"; reg = <0x01c19000 0x0400>; diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c index a2b67f7f8..d24496cac 100644 --- a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c +++ b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c @@ -31,6 +31,10 @@ static const struct ss_variant ss_a33_variant = { .sha1_in_be = true, }; +static const struct ss_variant ss_v3s_variant = { + .sha1_in_be = true, +}; + static struct sun4i_ss_alg_template ss_algs[] = { { .type = CRYPTO_ALG_TYPE_AHASH, .mode = SS_OP_MD5, @@ -505,6 +509,9 @@ static const struct of_device_id a20ss_crypto_of_match_table[] = { { .compatible = "allwinner,sun8i-a33-crypto", .data = &ss_a33_variant }, + { .compatible = "allwinner,sun8i-v3s-crypto", + .data = &ss_v3s_variant + }, {} }; MODULE_DEVICE_TABLE(of, a20ss_crypto_of_match_table);