From patchwork Wed Jan 23 16:55:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Konieczny X-Patchwork-Id: 10777583 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3890E13B5 for ; Wed, 23 Jan 2019 16:56:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27DBC2D4B2 for ; Wed, 23 Jan 2019 16:56:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C3572D4BA; Wed, 23 Jan 2019 16:56:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7B672D4B2 for ; Wed, 23 Jan 2019 16:56:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726140AbfAWQ4F (ORCPT ); Wed, 23 Jan 2019 11:56:05 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:36783 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbfAWQzz (ORCPT ); Wed, 23 Jan 2019 11:55:55 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190123165552euoutp02549c319cb8fc0982e35cf4c15e3012f4~8iJbAm7cw1410514105euoutp02Q for ; Wed, 23 Jan 2019 16:55:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190123165552euoutp02549c319cb8fc0982e35cf4c15e3012f4~8iJbAm7cw1410514105euoutp02Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1548262553; bh=9HACaCuVm3TaJmSWoPwBbGNxjVOi+0UlEM55NHEYao8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n9BdjdqCPbIFz/rIlN2X5fBPz+n+jHlb1OqnXLFJasDxAaXyPgJCS8x58EjPZ7MEX uJ1Omsl6W/66I5TzOxXJIKNFdQuEmqnrjJXdidAWcWGaW1FzGy74Qv25RtK2oKrccQ kyXBU47o+wrdp7p5o++8ebwpUKmm2USjPImhj0Uo= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190123165552eucas1p1ba8cce25881c10e171bb8ced4a618a14~8iJaOh0he2039320393eucas1p1v; Wed, 23 Jan 2019 16:55:52 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id F0.36.04441.79C984C5; Wed, 23 Jan 2019 16:55:51 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190123165551eucas1p2bb80cfe58535b5f665271c7448cffc30~8iJZeCHov0817608176eucas1p2O; Wed, 23 Jan 2019 16:55:51 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190123165551eusmtrp25a7ab1357b771981655a8c938ce9a1d3~8iJZPbW-C0112001120eusmtrp2K; Wed, 23 Jan 2019 16:55:51 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-69-5c489c97f1a2 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 73.58.04128.69C984C5; Wed, 23 Jan 2019 16:55:50 +0000 (GMT) Received: from AMDC3218.DIGITAL.local (unknown [106.120.51.18]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190123165550eusmtip1246a775a7ecd3b13a56b24fbcd9c00e4~8iJYpEFl60728607286eusmtip1W; Wed, 23 Jan 2019 16:55:50 +0000 (GMT) From: Kamil Konieczny To: k.konieczny@partner.samsung.com Cc: Herbert Xu , "David S. Miller" , Rob Herring , Mark Rutland , linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: [PATCH v2 2/3] dt-bindings: crypto: document Exynos5433 SlimSSS Date: Wed, 23 Jan 2019 17:55:32 +0100 Message-Id: <20190123165533.29645-3-k.konieczny@partner.samsung.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190123165533.29645-1-k.konieczny@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFKsWRmVeSWpSXmKPExsWy7djPc7rT53jEGKz5YWSxccZ6Vos551tY LOYfOcdq0f1KxqJv339Gi/PnN7Bb3L/3k8ni8q45bBZrj9xlt1h6/SKTReveI+wO3B5r5q1h 9Niy8iaTx7YDqh6bVnWyeRx8t4fJo2/LKkaPz5vkAtijuGxSUnMyy1KL9O0SuDLmLGpmKrjE X9HROo2pgbGZt4uRk0NCwETizrqTzF2MXBxCAisYJT49fMoK4XxhlDh6ajkbhPOZUeJs3yk2 mJZtKy8xQiSWM0rc/LmSCa7l2oOpYFVsAuYSj7afYQKxRQSUJSbfmw62hFmgg1ni7ZHZ7CAJ YQEPiTtfD7OC2CwCqhLHNjcwg9i8Ai4Sl7bNZ4FYJy8xbXUX0CAODk4BV4nOX2EQJYISJ2c+ ASthBipp3jobbL6EwC52iUuHz7OB1EsAzVm9OApijLDEq+Nb2CFs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DkKPWKEWBPLiitz DzFKcDArifC6XnSLEeJNSaysSi3Kjy8qzUktPsRoCvTDRGYp0eR8YJznlcQbmhqaW1gamhub G5tZKInznjeojBISSE8sSc1OTS1ILYLpY+LglGpgnCN6fYHDhxiv74fYpR78uPss8DNXkQWj y+xZdztNRFgWCL/Mv3NMmVXk+GPZZ7ffJki0P69NPJ8Z8sBpahzrz0i7vrMJV7RXMNWW+jc+ eNs5ZU9cuc3+74umrripn7ZAcPnRmWayXpOe/n+k+TZi78enjW7sweUqk7lfRjduSf13udfs 1UHjcCWW4oxEQy3mouJEAHKfBzm7AgAA X-CMS-MailID: 20190123165551eucas1p2bb80cfe58535b5f665271c7448cffc30 X-Msg-Generator: CA X-RootMTR: 20190123165551eucas1p2bb80cfe58535b5f665271c7448cffc30 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190123165551eucas1p2bb80cfe58535b5f665271c7448cffc30 References: <20190123165533.29645-1-k.konieczny@partner.samsung.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Document DT bindings for crypto Samsung Exynos5433 SlimSSS (Slim Security SubSystem) IP. Signed-off-by: Kamil Konieczny Reviewed-by: Krzysztof Kozlowski --- .../devicetree/bindings/crypto/samsung-sss.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/crypto/samsung-sss.txt b/Documentation/devicetree/bindings/crypto/samsung-sss.txt index 7a5ca56683cc..d9af679d38ab 100644 --- a/Documentation/devicetree/bindings/crypto/samsung-sss.txt +++ b/Documentation/devicetree/bindings/crypto/samsung-sss.txt @@ -1,4 +1,4 @@ -Samsung SoC SSS (Security SubSystem) module +Samsung SoC SSS (Security SubSystem) and SlimSSS module The SSS module in S5PV210 SoC supports the following: -- Feeder (FeedCtrl) @@ -15,6 +15,12 @@ supports the following also: -- True Random Number Generator (TRNG) -- Secure Key Manager +Exynos5433 has both SSS and SlimSSS module. +SlimSSS in Exynos5433 supports: +-- Feeder (FeedCtrl) +-- Advanced Encryption Standard (AES) +-- SHA-1/SHA-256/HMAC (SHA-1/SHA-256) + Required properties: - compatible : Should contain entries for this and backward compatible @@ -22,11 +28,13 @@ Required properties: - "samsung,s5pv210-secss" for S5PV210 SoC. - "samsung,exynos4210-secss" for Exynos4210, Exynos4212, Exynos4412, Exynos5250, Exynos5260 and Exynos5420 SoCs. + - "samsung,exynos5433-slim-sss" for Exynos5433 SoCs. - reg : Offset and length of the register set for the module - interrupts : interrupt specifiers of SSS module interrupts (one feed control interrupt). - clocks : list of clock phandle and specifier pairs for all clocks listed in clock-names property. -- clock-names : list of device clock input names; should contain one entry - "secss". +- clock-names : list of device clock input names; should contain "pclk" and + "aclk" for slim-sss in Exynos5433, and one entry "secss" for + other compatibles. From patchwork Wed Jan 23 16:55:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Konieczny X-Patchwork-Id: 10777589 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E0A4A13B5 for ; Wed, 23 Jan 2019 16:56:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1D7D2D4C1 for ; Wed, 23 Jan 2019 16:56:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C61CA2D4CA; Wed, 23 Jan 2019 16:56:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A031D2D4C1 for ; Wed, 23 Jan 2019 16:56:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726357AbfAWQ4I (ORCPT ); Wed, 23 Jan 2019 11:56:08 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:33352 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726234AbfAWQzy (ORCPT ); Wed, 23 Jan 2019 11:55:54 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190123165553euoutp014e58a537417f7227bf8650b5de126477~8iJbSzNFu2585325853euoutp01Y for ; Wed, 23 Jan 2019 16:55:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190123165553euoutp014e58a537417f7227bf8650b5de126477~8iJbSzNFu2585325853euoutp01Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1548262553; bh=nYdt+zRspMtA6gW+2p85Ojif+/CqFQBWjZ0c05/P7qM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nLSINnov9BLC//2uBfNt9bbk4aaQDdAF8T2S2SS4yaSuP8hYIOrGR7b7qZHvxlxbC keq3xf6dPlAlXAowf6QYqr4gB8CUoOTkVl3Y+8S81ZaRNwAbjn1L//Ecrwcy5ObCUN xDz++jbGahWDVOYnWUvII6n+AjC9qmeO/QEQekZQ= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190123165552eucas1p1b41feb57b4b7316a1a26f337b3618706~8iJa1yZnG0827108271eucas1p1Q; Wed, 23 Jan 2019 16:55:52 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id B1.36.04441.89C984C5; Wed, 23 Jan 2019 16:55:52 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190123165551eucas1p1cd99462e3767dbb4feb88b996225ed21~8iJaGU02y2306623066eucas1p1E; Wed, 23 Jan 2019 16:55:51 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190123165551eusmtrp25017c8ec7c0ba3f83ec0b703bb4488f5~8iJZ35FjS0112001120eusmtrp2M; Wed, 23 Jan 2019 16:55:51 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-6b-5c489c989e65 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 99.32.04284.79C984C5; Wed, 23 Jan 2019 16:55:51 +0000 (GMT) Received: from AMDC3218.DIGITAL.local (unknown [106.120.51.18]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190123165551eusmtip1875742def9bbc0418dbc5950aa0c7edf~8iJZLe56a0754507545eusmtip15; Wed, 23 Jan 2019 16:55:50 +0000 (GMT) From: Kamil Konieczny To: k.konieczny@partner.samsung.com Cc: Krzysztof Kozlowski , Vladimir Zapolskiy , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: [PATCH v2 3/3] crypto: s5p: add AES support for Exynos5433 Date: Wed, 23 Jan 2019 17:55:33 +0100 Message-Id: <20190123165533.29645-4-k.konieczny@partner.samsung.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190123165533.29645-1-k.konieczny@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0gUYRTtm5l1x8WxcRW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j9xlt/j/q5nZgctjy8qbTB7bDqh6 bFrVyebxb+EUFo+D7/YwefRtWcXo8XmTXAB7lJ5NUX5pSapCRn5xia1StKGFkZ6hpYWekYml nqGxeayVkamSvp1NSmpOZllqkb5dgl7G5P53jAUb5SqeTtrD2sC4RKKLkZNDQsBEYn3PfJYu Ri4OIYGljBJvGs+yQCSkJRpPr2aCsIUl/lzrYoMo+sQo8WrldjaQBJuAucSj7WfAikQElCUm 35vODGIzC3xkkvizihvEFhZwlnj34inQUA4OFgFVidk7DEHCvAIuEtMWvGWHmC8vMW11FxNI CaeAq0TnrzCQsBBQyfMDX1ghygUlTs58wgIxXV6ieets5gmMArOQpGYhSS1gZFrFKJJaWpyb nltsqFecmFtcmpeul5yfu4kRGD/bjv3cvIPx0sbgQ4wCHIxKPLwb8jxihFgTy4orcw8xSnAw K4nwul50ixHiTUmsrEotyo8vKs1JLT7EaAr0wkRmKdHkfGBs55XEG5oamltYGpobmxubWSiJ 8543qIwSEkhPLEnNTk0tSC2C6WPi4JRqYIxS/fzGQbLUpenHu/5G2aDw/fwrNARms619zlrc 6zYtN76ocfrLtb+6p8/QzDpQZfAt1czxvBKv5YmNF9bYVu9fdbDtpavfmuc6i92Xq/fKh22d a1emmJrDfGZnI8s5tjyn7tw/Ry6qnJv1PmO9fJnTn+M2OgKK10oydIr8iyamJLKmWPbeUmIp zkg01GIuKk4EAEESLf+1AgAA X-CMS-MailID: 20190123165551eucas1p1cd99462e3767dbb4feb88b996225ed21 X-Msg-Generator: CA X-RootMTR: 20190123165551eucas1p1cd99462e3767dbb4feb88b996225ed21 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190123165551eucas1p1cd99462e3767dbb4feb88b996225ed21 References: <20190123165533.29645-1-k.konieczny@partner.samsung.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add AES crypto HW acceleration for Exynos5433, with the help of SlimSSS IP. Signed-off-by: Kamil Konieczny Reviewed-by: Krzysztof Kozlowski --- drivers/crypto/s5p-sss.c | 50 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index 0064be0e3941..e2d247f59254 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -232,6 +232,7 @@ * struct samsung_aes_variant - platform specific SSS driver data * @aes_offset: AES register offset from SSS module's base. * @hash_offset: HASH register offset from SSS module's base. + * @clk_names: names of clocks needed to run SSS IP * * Specifies platform specific configuration of SSS module. * Note: A structure for driver specific platform data is used for future @@ -240,6 +241,7 @@ struct samsung_aes_variant { unsigned int aes_offset; unsigned int hash_offset; + char *clk_names[]; }; struct s5p_aes_reqctx { @@ -296,6 +298,7 @@ struct s5p_aes_ctx { struct s5p_aes_dev { struct device *dev; struct clk *clk; + struct clk *pclk; void __iomem *ioaddr; void __iomem *aes_ioaddr; int irq_fc; @@ -384,11 +387,19 @@ struct s5p_hash_ctx { static const struct samsung_aes_variant s5p_aes_data = { .aes_offset = 0x4000, .hash_offset = 0x6000, + .clk_names = { "secss", }, }; static const struct samsung_aes_variant exynos_aes_data = { .aes_offset = 0x200, .hash_offset = 0x400, + .clk_names = { "secss", }, +}; + +static const struct samsung_aes_variant exynos5433_slim_aes_data = { + .aes_offset = 0x400, + .hash_offset = 0x800, + .clk_names = { "pclk", "aclk", }, }; static const struct of_device_id s5p_sss_dt_match[] = { @@ -400,6 +411,10 @@ static const struct of_device_id s5p_sss_dt_match[] = { .compatible = "samsung,exynos4210-secss", .data = &exynos_aes_data, }, + { + .compatible = "samsung,exynos5433-slim-sss", + .data = &exynos5433_slim_aes_data, + }, { }, }; MODULE_DEVICE_TABLE(of, s5p_sss_dt_match); @@ -2208,18 +2223,39 @@ static int s5p_aes_probe(struct platform_device *pdev) return PTR_ERR(pdata->ioaddr); } - pdata->clk = devm_clk_get(dev, "secss"); + pdata->clk = devm_clk_get(dev, variant->clk_names[0]); if (IS_ERR(pdata->clk)) { - dev_err(dev, "failed to find secss clock source\n"); + dev_err(dev, "failed to find secss clock %s\n", + variant->clk_names[0]); return -ENOENT; } err = clk_prepare_enable(pdata->clk); if (err < 0) { - dev_err(dev, "Enabling SSS clk failed, err %d\n", err); + dev_err(dev, "Enabling clock %s failed, err %d\n", + variant->clk_names[0], err); return err; } + if (variant->clk_names[1]) { + pdata->pclk = devm_clk_get(dev, variant->clk_names[1]); + if (IS_ERR(pdata->pclk)) { + dev_err(dev, "failed to find clock %s\n", + variant->clk_names[1]); + err = -ENOENT; + goto err_clk; + } + + err = clk_prepare_enable(pdata->pclk); + if (err < 0) { + dev_err(dev, "Enabling clock %s failed, err %d\n", + variant->clk_names[0], err); + goto err_clk; + } + } else { + pdata->pclk = NULL; + } + spin_lock_init(&pdata->lock); spin_lock_init(&pdata->hash_lock); @@ -2295,8 +2331,11 @@ static int s5p_aes_probe(struct platform_device *pdev) tasklet_kill(&pdata->tasklet); err_irq: - clk_disable_unprepare(pdata->clk); + if (pdata->pclk) + clk_disable_unprepare(pdata->pclk); +err_clk: + clk_disable_unprepare(pdata->clk); s5p_dev = NULL; return err; @@ -2323,6 +2362,9 @@ static int s5p_aes_remove(struct platform_device *pdev) pdata->use_hash = false; } + if (pdata->pclk) + clk_disable_unprepare(pdata->pclk); + clk_disable_unprepare(pdata->clk); s5p_dev = NULL;