From patchwork Wed Jan 23 16:55:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Konieczny X-Patchwork-Id: 10777587 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 238901575 for ; Wed, 23 Jan 2019 16:56:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 144D72D4B7 for ; Wed, 23 Jan 2019 16:56:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 086CA2D4BD; Wed, 23 Jan 2019 16:56:09 +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 AB6D72D4B7 for ; Wed, 23 Jan 2019 16:56:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726166AbfAWQzy (ORCPT ); Wed, 23 Jan 2019 11:55:54 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:36765 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbfAWQzx (ORCPT ); Wed, 23 Jan 2019 11:55:53 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190123165552euoutp02f7a0b57b26b69f8118bd5b2cd4878396~8iJazswz01410214102euoutp02U for ; Wed, 23 Jan 2019 16:55:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190123165552euoutp02f7a0b57b26b69f8118bd5b2cd4878396~8iJazswz01410214102euoutp02U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1548262552; bh=PzMg4GV1XDi6Y5SAe2HJT0Zvt3QmVJ+RidOcaZENDo4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I5VEf+i5T94R4VphrY2TtCQ6Z/e3NHZpR89R6WCP4fIfgdT5vFgwZUOmY69TH8dCV h98n1cQRqpkAR3lV8BoPFnYDVhyV3UJyXsn7M4ujCgd30rM6jS3WsLfupnLZ9Vj0Tt Acnb6WKdu51OlwoT9eyJ7xQWW3lk+QAmhJ1al5BM= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190123165551eucas1p1efaadcf042c497005404751179695382~8iJZnypc72033420334eucas1p1o; Wed, 23 Jan 2019 16:55:51 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 3C.42.04806.79C984C5; Wed, 23 Jan 2019 16:55:51 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190123165550eucas1p1ab8721d90007c689f887d315c926a267~8iJY5rwk11659116591eucas1p1V; Wed, 23 Jan 2019 16:55:50 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190123165550eusmtrp1bc9b197397d15b335c8313f9568f3d17~8iJYq8_nf0321203212eusmtrp1K; Wed, 23 Jan 2019 16:55:50 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-82-5c489c973bd5 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 78.32.04284.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 20190123165549eusmtip1b5c1646435565180271e97619785c5cb~8iJYE9P840754507545eusmtip14; Wed, 23 Jan 2019 16:55:49 +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 v2 1/3] arm64: dts: exynos: add SlimSSS for Exynos5433 Date: Wed, 23 Jan 2019 17:55:31 +0100 Message-Id: <20190123165533.29645-2-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+NgFtrCKsWRmVeSWpSXmKPExsWy7djPc7rT53jEGNyYzWuxccZ6Vov5R86x WvTt+89o0f/4NbPF+fMb2C02Pb7GanF51xw2ixnn9zFZrD1yl91i6fWLTBate4+wO3B7rJm3 htFj06pONo/NS+o9Dr7bw+TRt2UVo8fnTXIBbFFcNimpOZllqUX6dglcGfOm72Is6OeoaL26 iLWB8SlbFyMnh4SAicTqO1vZuxi5OIQEVjBKrLz0hRXC+cIocfbKNKjMZ6DMh/3sMC3LV15k BbGFBJYzSjzbbwzXce36NxaQBJuAucSj7WeYQGwRAWWJyfemM4MUMQv8Z5JYeGcJ2HJhATeJ l5dBpnJwsAioSixeyAcS5hVwkdjz9gsLxDJ5iWmru5hASjgFXCU6f4VBlAhKnJz5BKyEGaik eetssPESAtvYJT6saGCF6HWR2D+3BcoWlnh1fAvUAzISpyf3QM0vl9i99Rk7RHMLo8TcyYuY IBLWEoePg3zJAbRBU2L9Ln0QU0LAUaLp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8YamhuYWlobmxubGZhZK 4rznDSqjhATSE0tSs1NTC1KLYPqYODilGhh1V5fce1I4vTuJ7yl32affN2btOlrZy2T1YGIc Q2aICrfpTE8PN96OV4dErscu360ZYSeUdGvP2mkn/A0EOGXzRNUnrGLXM6xJ/MB7pMBoQmjW lzdrP9WyGd2u2mDf3KdwsCv+hE6i0D/GZRqbFBe63Vx4s6jxZuFc3ttG/luv1190nb/KRVyJ pTgj0VCLuag4EQB8ujhdtwIAAA== X-CMS-MailID: 20190123165550eucas1p1ab8721d90007c689f887d315c926a267 X-Msg-Generator: CA X-RootMTR: 20190123165550eucas1p1ab8721d90007c689f887d315c926a267 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190123165550eucas1p1ab8721d90007c689f887d315c926a267 References: <20190123165533.29645-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 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: 10777585 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 9939C139A for ; Wed, 23 Jan 2019 16:56:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88F9C2D4B7 for ; Wed, 23 Jan 2019 16:56:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D7062D4BA; Wed, 23 Jan 2019 16:56:08 +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 F30252D4B8 for ; Wed, 23 Jan 2019 16:56:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726352AbfAWQ4H (ORCPT ); Wed, 23 Jan 2019 11:56:07 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:33358 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbfAWQzz (ORCPT ); Wed, 23 Jan 2019 11:55:55 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190123165553euoutp01e2b280f6acbddc980f061f843058b7cd~8iJbl6yS12775127751euoutp01B for ; Wed, 23 Jan 2019 16:55:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190123165553euoutp01e2b280f6acbddc980f061f843058b7cd~8iJbl6yS12775127751euoutp01B 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: H4sIAAAAAAAAA01Sa0gUYRTtm5l1x8WxcRW8qBhtChWpCUYDhihpza+Qon6YZZsOKj7b8V2B 5eJjFSs136WWko9ydVnNV2ImLZW0mEiG5SPSzHSVTEQJN3dnLf+de+8595wLl8SlHSInMjo+ iVPEy2NlVhKi8/WG3qO8mg09emsJmPZytYip1isJJn/BhSnsNyJGr28TM1OTGxgz2lNtxZTr +zHm2dAXMWPczML9Jay26RPGdg64s5rmPCt2q66EYF8a+jC2UNuM2FWNa7A4RHIigouNTuEU Xn5XJFHFdwwosd01bbaoT5SJ6kGFrEmgfWBifYZQIQkppRsRTN1fFgnFbwT5xctioVhF8Kdx k9iRqAtqLJIn25KPJfg/yXpLmZllRR+Hr8+HMRN2oA9A8WSZmYTTPzFom1gwD+zpk2CYn90W kCRBu0NVl7epTdGBUFq7JBbc9kFpiwozUazpIMjbvCBQ7OBNxTezFb5NyeqoMq8HWiOGgW6D JWkgVCw2WLA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8vKs1JLT7EaAr0wkRmKdHkfGBs55XEG5oamltYGpobmxubWSiJ 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-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 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;