From patchwork Tue Jan 22 15:25:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Konieczny X-Patchwork-Id: 10775769 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 626D61390 for ; Tue, 22 Jan 2019 15:26:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CF422AE42 for ; Tue, 22 Jan 2019 15:26:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40D392AEAD; Tue, 22 Jan 2019 15:26:35 +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 C9D512AEB1 for ; Tue, 22 Jan 2019 15:26:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729696AbfAVP0M (ORCPT ); Tue, 22 Jan 2019 10:26:12 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:54835 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729772AbfAVP0L (ORCPT ); Tue, 22 Jan 2019 10:26:11 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190122152610euoutp024523b122e125fb68b2b5798d1d3996be~8NRzk10t92916929169euoutp026 for ; Tue, 22 Jan 2019 15:26:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190122152610euoutp024523b122e125fb68b2b5798d1d3996be~8NRzk10t92916929169euoutp026 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1548170770; bh=PzMg4GV1XDi6Y5SAe2HJT0Zvt3QmVJ+RidOcaZENDo4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AlaGbE9RmLmITcB29dIxsP16Bn54zs0oFR4x/tKueV+4ITNSUYPxBeR9DQLuQ+Xc9 D6eXeIVx6pYgpcUdjvBrxlR8idWoyUPd3yNuWAeP3j1eBMAK2Adb5llFt2fuLq4xZC POKwTQRzxhzZ23YqLauDjLGfntP2C+7thcdHZ8zk= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190122152609eucas1p103a9a571fc41292b09fde7fa3aea0051~8NRy10WV20988509885eucas1p1B; Tue, 22 Jan 2019 15:26:09 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id C1.69.04294.016374C5; Tue, 22 Jan 2019 15:26:08 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190122152608eucas1p298d06d6b1232a37be8c1679b7a626811~8NRyCKGhr1516415164eucas1p2q; Tue, 22 Jan 2019 15:26:08 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190122152608eusmtrp2b595d28960f2e91462f7dc6a187ae25a~8NRxzLEdf0539205392eusmtrp2U; Tue, 22 Jan 2019 15:26:08 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-e4-5c4736106842 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 69.89.04284.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 20190122152607eusmtip26678e806b1a425d762ce8cf308001c7a~8NRxQ2SVb0472704727eusmtip27; Tue, 22 Jan 2019 15:26:07 +0000 (GMT) From: Kamil Konieczny To: k.konieczny@partner.samsung.com Cc: Rob Herring , Mark Rutland , Kukjin Kim , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: [PATCH v1 1/3] arm64: dts: exynos: add SlimSSS for Exynos5433 Date: Tue, 22 Jan 2019 16:25:51 +0100 Message-Id: <20190122152553.1537-2-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+NgFtrKKsWRmVeSWpSXmKPExsWy7djP87oCZu4xBv+eWVpsnLGe1WL+kXOs Fn37/jNa9D9+zWxx/vwGdotNj6+xWlzeNYfNYsb5fUwWa4/cZbdYev0ik0Xr3iPsDtwea+at YfTYtKqTzWPzknqPg+/2MHn0bVnF6PF5k1wAWxSXTUpqTmZZapG+XQJXxrzpuxgL+jkqWq8u Ym1gfMrWxcjJISFgInHl62XWLkYuDiGBFYwSEzqmMoEkhAS+MErcfGsOkfjMKDG99wArTMf8 Z6tZIBLLGSX+HTjPDOEAdXx91g/WziZgLvFo+xkwW0RAWWLyvelgRcwC/5kkFt5ZArScg0NY wE2i+2IOSA2LgKrE9U1rwep5BZwl/r3uZ4bYJi8xbXUXWJxTwEXi/KlVrBA1ghInZz5hAbGZ gWqat84Gmy8hsIld4mnbArD5EkANN47UQMwRlnh1fAs7hC0j8X/nfCYIu1xi99Zn7BC9LYwS cycvgkpYSxw+fpEVZA6zgKbE+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3oFiPEm5JYWZValB9fVJqTWnyI0RToiYnMUqLJ+cAIzyuJNzQ1NLewNDQ3Njc2s1AS 5z1vUBklJJCeWJKanZpakFoE08fEwSnVwDi5q3o976O5ilbLhfcm7l975V3v9yW+ZQ6x/Mmq ks3u2yt83iypNTxlxfjxXf5ylUKjpwcMwpp6En6xKlqebpBVD68O2yB0e87sBzPXFjjJOa+S b0wolH9Q9ELae9azvVFln9Lu7vDXfmhXFfNQmuuJZfCD4LqX8x+rmT8LvzdlbfJzDhaZhUos xRmJhlrMRcWJAH8RkzG4AgAA X-CMS-MailID: 20190122152608eucas1p298d06d6b1232a37be8c1679b7a626811 X-Msg-Generator: CA X-RootMTR: 20190122152608eucas1p298d06d6b1232a37be8c1679b7a626811 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190122152608eucas1p298d06d6b1232a37be8c1679b7a626811 References: <20190122152553.1537-1-k.konieczny@partner.samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add DT node for SlimSSS (aka Slim SecuritySubSystem) in Exynos5433 SoC. The users can use compatibility "samsung,exynos5433-slim-sss". Signed-off-by: Kamil Konieczny --- arch/arm64/boot/dts/exynos/exynos5433.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/exynos5433.dtsi b/arch/arm64/boot/dts/exynos/exynos5433.dtsi index e7cd3b67d818..9e5fcb6c7776 100644 --- a/arch/arm64/boot/dts/exynos/exynos5433.dtsi +++ b/arch/arm64/boot/dts/exynos/exynos5433.dtsi @@ -559,6 +559,15 @@ <&cmu_top CLK_DIV_ACLK_IMEM_200>; }; + slim_sss: slim-sss@11140000 { + compatible = "samsung,exynos5433-slim-sss"; + reg = <0x11140000 0x1000>; + interrupts = ; + clock-names = "aclk", "pclk"; + clocks = <&cmu_imem CLK_ACLK_SLIMSSS>, + <&cmu_imem CLK_PCLK_SLIMSSS>; + }; + pd_gscl: power-domain@105c4000 { compatible = "samsung,exynos5433-pd"; reg = <0x105c4000 0x20>; 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: 10775771 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 9249A6C2 for ; Tue, 22 Jan 2019 15:26:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 821CC2AE42 for ; Tue, 22 Jan 2019 15:26:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 747832AEB1; Tue, 22 Jan 2019 15:26:48 +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 075332AE42 for ; Tue, 22 Jan 2019 15:26:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729124AbfAVP0f (ORCPT ); Tue, 22 Jan 2019 10:26:35 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:54848 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729199AbfAVP0M (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 20190122152611euoutp021bac7355fd51fe957cbd4e08133283df~8NR0hM4k-2916929169euoutp028 for ; Tue, 22 Jan 2019 15:26:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190122152611euoutp021bac7355fd51fe957cbd4e08133283df~8NR0hM4k-2916929169euoutp028 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+NgFtrGKsWRmVeSWpSXmKPExsWy7djP87pCZu4xBmfOs1hsnLGe1WLO+RYW i+5XMhZ9+/4zWpw/v4Hd4v69n0wWl3fNYbOYcX4fk8XaI3fZLf7/amZ24PLYsvImk8e2A6oe m1Z1snn8WziFxePguz1MHn1bVjF6fN4kF8AexWWTkpqTWZZapG+XwJWxt6mfqeCBXMX041YN jBcluhg5OSQETCR2XGtm62Lk4hASWMEoMXH7dXYI5wujxOfzC1ghnM+MEreaTrDBtHxqO8EE kVjOKHGypZkJruVH50OwKjYBc4lH288wgdgiAsoSk+9NZwYpYhZ4zSSx4fYrsISwgLPE0TUL mUFsFgFViQ2zVrOC2LxA8UdH1zJCrJOXmLa6C6yeU8BF4vypVVA1ghInZz5hAbGZgWqat84G WyAhsI5d4uz9b1DNLhJTH72CultY4tXxLewQtoz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4uHlOOcaI8SaWFZcmXuIUYKDWUmE1/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-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@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;