From patchwork Tue Jan 22 15:25:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Konieczny X-Patchwork-Id: 10775773 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 B36D31390 for ; Tue, 22 Jan 2019 15:26:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A20E82AEAD for ; Tue, 22 Jan 2019 15:26:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94A532AE42; Tue, 22 Jan 2019 15:26:49 +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 2A9D02AE42 for ; Tue, 22 Jan 2019 15:26:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729282AbfAVP0s (ORCPT ); Tue, 22 Jan 2019 10:26:48 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:49949 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728918AbfAVP0M (ORCPT ); Tue, 22 Jan 2019 10:26:12 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190122152610euoutp01eb9c1a5a7323fda00d5d451037a6fdac~8NRz-Z-2-0912009120euoutp01u for ; Tue, 22 Jan 2019 15:26:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190122152610euoutp01eb9c1a5a7323fda00d5d451037a6fdac~8NRz-Z-2-0912009120euoutp01u DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1548170770; bh=XhXEUQE5xAKbwygfA7Rdfb9KqEGaRFuvNk9iE5BJLeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d02JLUi/7SY+ki+lRCcSToGkr87xVapJusChBZjFwT7vv3UMyxDFO7+axUWuyEjMk 8ZCzeRyt16jQcHV2XsdbQSujhfiE1G/QdL4Q8lZoD7PkdUg10m+0aJXUDcBmvd+Yf0 p/edVB8hT8A9WNcgIGcs5xJ8z6wApWspJzQjdbyc= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190122152609eucas1p1be2c43da974544abc829e9d5f9aa37ef~8NRzRT7uj0417804178eucas1p1D; Tue, 22 Jan 2019 15:26:09 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 06.F0.04806.116374C5; Tue, 22 Jan 2019 15:26:09 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190122152608eucas1p27cff7b53eb3bb23447ef7ba2b3f69671~8NRyhJlmc1355913559eucas1p2b; Tue, 22 Jan 2019 15:26:08 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190122152608eusmtrp20261dd303d1b385f6046d7859c7a4e03~8NRySmTs10539205392eusmtrp2V; Tue, 22 Jan 2019 15:26:08 +0000 (GMT) X-AuditID: cbfec7f5-367ff700000012c6-1a-5c4736118956 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FD.FF.04128.016374C5; Tue, 22 Jan 2019 15:26:08 +0000 (GMT) Received: from AMDC3218.DIGITAL.local (unknown [106.120.51.18]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190122152608eusmtip21d8df1e7e36aaccbdea35ed588611300~8NRxyhDUY0551405514eusmtip2y; Tue, 22 Jan 2019 15:26:08 +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 v1 2/3] dt-bindings: crypto: document Exynos5433 SlimSSS Date: Tue, 22 Jan 2019 16:25:52 +0100 Message-Id: <20190122152553.1537-3-k.konieczny@partner.samsung.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190122152553.1537-1-k.konieczny@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTYRjuO2fbOZvOjnPki1nRwh8VZmHUiSIKtQ6ioFAkZdS0g0rbtB2v 9SeYt2aIJGl5TUO0ecuhs1yK2UhTc9nFkkotS7qgRlqmVrbjUfLf8z0XnueFj8QVVrEHGaOL Z/U6tUYlkYksD2f7vF13HQ7f3v7Ok264Vi+mi+ypIrrU1iems7540tltC4i2228T9PDQLEY/ aymS0LW2twRd8bIfo9NabcQBJ6ampAYxjbcGMcbS7sWYTZckzP2JexiT3WhCzJR5fQhxXLbv DKuJSWT1PvtPy6Kvmt6huK7VyYaer6KLaN7ZiKQkUDvBUFaLGZGMVFBVCKxFDWJeUFDTCIps CYIwhaBsvEq0nCg0ZEkEoRLBSOlHJDwciSHTC8S7JNRueN/ci/FYSW2C3KF8nDfhVCYO47ZC ghfcKAYel5fgPBZRXpCbOroYkFN+YDZP4ELdBsirNi7yUsof7N0mseBxhUfXPyxO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LwJF1xjhFgTy4orcw8x SnAwK4nwul50ixHiTUmsrEotyo8vKs1JLT7EaAr0xERmKdHkfGCs55XEG5oamltYGpobmxub WSiJ8543qIwSEkhPLEnNTk0tSC2C6WPi4JRqYLSabK253Mjl8g9/may4WzKlYe9sUxximN0r Kt1jt6xk9O/NeLo83kjKdJuxq7WCKJdTe12L48RPyT6cZ+JENSorjJ3Ftgc3Fs61SwmyDvw6 z7Ve+Hxd1W8rkX1Z8v4HX89X6fney2Az1XCdz6xfCY73nhTezv1lyXSdJ5zBj11n5fYPBfFK LMUZiYZazEXFiQD+1HEkvQIAAA== X-CMS-MailID: 20190122152608eucas1p27cff7b53eb3bb23447ef7ba2b3f69671 X-Msg-Generator: CA X-RootMTR: 20190122152608eucas1p27cff7b53eb3bb23447ef7ba2b3f69671 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190122152608eucas1p27cff7b53eb3bb23447ef7ba2b3f69671 References: <20190122152553.1537-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 --- .../devicetree/bindings/crypto/samsung-sss.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/crypto/samsung-sss.txt b/Documentation/devicetree/bindings/crypto/samsung-sss.txt index 7a5ca56683cc..75718f86fe50 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,11 @@ supports the following also: -- True Random Number Generator (TRNG) -- Secure Key Manager +The SlimSSS module in Exynos5 (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 +27,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 Exynos542x and 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 Tue Jan 22 15:25:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Konieczny X-Patchwork-Id: 10775761 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 A1E341390 for ; Tue, 22 Jan 2019 15:26:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E1622AA59 for ; Tue, 22 Jan 2019 15:26:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 822892AAEC; Tue, 22 Jan 2019 15:26:17 +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 0C1802AEAD for ; Tue, 22 Jan 2019 15:26:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729838AbfAVP0M (ORCPT ); Tue, 22 Jan 2019 10:26:12 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:54847 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728997AbfAVP0M (ORCPT ); Tue, 22 Jan 2019 10:26:12 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190122152610euoutp02fd8bc5151160210360081ea572cc486a~8NR0YF9Hd3007530075euoutp02G for ; Tue, 22 Jan 2019 15:26:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190122152610euoutp02fd8bc5151160210360081ea572cc486a~8NR0YF9Hd3007530075euoutp02G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1548170771; bh=0iS4N47zJ6GyLB+EN4i3sgvj82GJztVtoi19B0s9OrY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N2ch5ClnWlOS1nbrsqbHwDuKEsNYdG5V1cCuj3I0vkV6v0LemsZqZio3hxqHMSvLM JFFUQr4AwX/PysyjcM/5SP+7Ia83OkBf3UPLQlE7mkE/YVX6+rtL6yBBXfN94lyGXY RTB5iW1OKOdfctBwgoHydZ6/Yv0kib3j+UKkhyRs= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190122152610eucas1p1bafb37c557947c997db48bc4f47c8553~8NRzxvR2f2950829508eucas1p1N; Tue, 22 Jan 2019 15:26:10 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id E2.69.04294.216374C5; Tue, 22 Jan 2019 15:26:10 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190122152609eucas1p287b83592af600dc080374a197e6dd917~8NRzGSoR51298012980eucas1p2M; Tue, 22 Jan 2019 15:26:09 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190122152609eusmtrp23b76f5bd4ca80b7a783816e0197c5107~8NRyweIKw0539705397eusmtrp2Y; Tue, 22 Jan 2019 15:26:09 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-e8-5c4736126fb7 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 8A.89.04284.116374C5; Tue, 22 Jan 2019 15:26:09 +0000 (GMT) Received: from AMDC3218.DIGITAL.local (unknown [106.120.51.18]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190122152608eusmtip2f0abca2c9e35bd6a8c2e15adb74672e1~8NRyRd97Y0551005510eusmtip25; Tue, 22 Jan 2019 15:26:08 +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 v1 3/3] crypto: s5p: add AES support for Exynos5433 Date: Tue, 22 Jan 2019 16:25:53 +0100 Message-Id: <20190122152553.1537-4-k.konieczny@partner.samsung.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190122152553.1537-1-k.konieczny@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGKsWRmVeSWpSXmKPExsWy7djP87pCZu4xBmfOs1hsnLGe1WL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tas62Tz+LZzC4nHw3R4mj74tqxg9Pm+SC2CP0rMpyi8tSVXIyC8usVWKNrQw0jO0tNAzMrHU MzQ2j7UyMlXSt7NJSc3JLEst0rdL0MvY29TPVPBArmL6casGxosSXYycHBICJhKf2k4wgdhC AksZJVrOyULEpSUaT69mgrCFJf5c62LrYuQCqvnEKHH+9DF2kASbgLnEo+1nwIpEBJQlJt+b zgxiMwt8ZJL4s4obxBYWcJY4umYhWJxFQFViw6zVrCA2L1D80dG1jBAL5CWmre4Cm8Mp4CJx /tQqVoiDnCUeT5gDVS8ocXLmExaI+fISzVtnM09gFJiFJDULSWoBI9MqRpHU0uLc9NxiQ73i xNzi0rx0veT83E2MwPjZduzn5h2MlzYGH2IU4GBU4uHlOOcaI8SaWFZcmXuIUYKDWUmE1/Wi W4wQb0piZVVqUX58UWlOavEhRlOgJyYyS4km5wNjO68k3tDU0NzC0tDc2NzYzEJJnPe8QWWU kEB6YklqdmpqQWoRTB8TB6dUA6Pipxn7e0syLv7SDHLLqFTeJFn9h+vyw5LLHvc1pPdeFn79 Ivv3Uqnm8r1F33+JJoX3mjuknn5Sm57MMzfhfbxXK/MfryPKtzt0Z+vc5T7neMz6lvOlORMF nrl+PLFok+v8SYef6z30zaz9+L2aPfHmM9ZS7rp5RUZbc9fb2v+VzBO5oud2g1mJpTgj0VCL uag4EQAmdMqstQIAAA== X-CMS-MailID: 20190122152609eucas1p287b83592af600dc080374a197e6dd917 X-Msg-Generator: CA X-RootMTR: 20190122152609eucas1p287b83592af600dc080374a197e6dd917 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190122152609eucas1p287b83592af600dc080374a197e6dd917 References: <20190122152553.1537-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 --- 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..1ae570ad4391 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,40 @@ 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]); + clk_disable_unprepare(pdata->clk); + return -ENOENT; + } + + err = clk_prepare_enable(pdata->pclk); + if (err < 0) { + dev_err(dev, "Enabling clock %s failed, err %d\n", + variant->clk_names[0], err); + clk_disable_unprepare(pdata->clk); + return err; + } + } else { + pdata->pclk = NULL; + } + spin_lock_init(&pdata->lock); spin_lock_init(&pdata->hash_lock); @@ -2295,8 +2332,10 @@ 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); + 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;