From patchwork Thu Jan 24 15:45:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Konieczny X-Patchwork-Id: 10779405 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 DE66C13BF for ; Thu, 24 Jan 2019 15:46:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD97B3162D for ; Thu, 24 Jan 2019 15:46:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBCB931673; Thu, 24 Jan 2019 15:46:04 +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 606683163E for ; Thu, 24 Jan 2019 15:46:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727933AbfAXPpm (ORCPT ); Thu, 24 Jan 2019 10:45:42 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55957 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728061AbfAXPpm (ORCPT ); Thu, 24 Jan 2019 10:45:42 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190124154540euoutp0101c0f0c90bba6e0590bcc417561182ff~801Z_PDap2677026770euoutp01V for ; Thu, 24 Jan 2019 15:45:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190124154540euoutp0101c0f0c90bba6e0590bcc417561182ff~801Z_PDap2677026770euoutp01V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1548344740; bh=PzMg4GV1XDi6Y5SAe2HJT0Zvt3QmVJ+RidOcaZENDo4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RwTzTyirfyeAfbVWUkiVSEV/nFSW7shTHJ37uwP+8qUr/zL62WN9UwStH6zu9i7Wn x4d4ChJgtFNimI28/U7D4O6s+wLLe2qxq6smZh6fyakSXsLyIqdZv4VgBMRMFWeJ/R HSKincZpANhSvQJy9nWa8i3O+xy6rpC6zloGI6go= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190124154539eucas1p1dbf6c93dca26dc85f023df86cb467229~801ZWGLAd1368013680eucas1p1V; Thu, 24 Jan 2019 15:45:39 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 49.31.04806.3ADD94C5; Thu, 24 Jan 2019 15:45:39 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190124154538eucas1p2cdc2ce1eab4446e3ac139fd07d622ca7~801YlMxaD0349803498eucas1p2c; Thu, 24 Jan 2019 15:45:38 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190124154538eusmtrp26496d38667cad7a9a33d0476054bc169~801YWj5ga1826018260eusmtrp2q; Thu, 24 Jan 2019 15:45:38 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-e6-5c49dda367bf Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 82.59.04284.2ADD94C5; Thu, 24 Jan 2019 15:45:38 +0000 (GMT) Received: from AMDC3218.DIGITAL.local (unknown [106.120.51.18]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190124154537eusmtip22c457d4332a782cda8616e044cae4f91~801XndraN2489624896eusmtip2X; Thu, 24 Jan 2019 15:45:37 +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 v3 1/3] arm64: dts: exynos: add SlimSSS for Exynos5433 Date: Thu, 24 Jan 2019 16:45:19 +0100 Message-Id: <20190124154521.13589-2-k.konieczny@partner.samsung.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190124154521.13589-1-k.konieczny@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOKsWRmVeSWpSXmKPExsWy7djP87qL73rGGLTOEbHYOGM9q8X8I+dY Lfr2/We06H/8mtni/PkN7BabHl9jtbi8aw6bxYzz+5gs1h65y26x9PpFJovWvUfYHbg91sxb w+ixaVUnm8fmJfUeB9/tYfLo27KK0ePzJrkAtigum5TUnMyy1CJ9uwSujHnTdzEW9HNUtF5d xNrA+JSti5GTQ0LARGL90r3MXYxcHEICKxglnv26AuV8YZRYvnQqI4TzmVGi78pudpiWebNe Q1UtZ5RYcPIQO1zLw01HwAazCZhLPNp+hgnEFhFQlph8bzpYB7PAfyaJhXeWgBUJC7hJ3L91 ixXEZhFQldh6/gXQJA4OXgEXiecHOCC2yUtMW90FNodTwFVi74RmFhCbV0BQ4uTMJ2A2M1BN 89bZYPMlBDaxS2x51MAK0ewicXzGRxYIW1ji1fEtUC/ISPzfOZ8Jwi6X2L31GTtEcwujxNzJ i6AS1hKHj19kBTmIWUBTYv0ufYiwo0T7ghNsIG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kl8YamhuYWlobmxubGZhZK 4rznDSqjhATSE0tSs1NTC1KLYPqYODilGhgDd1j+4SueFfS9PpXJUkDMdfXitmsclm8dLByn S7L0Taj42zhBcOuJ/k61BVHpiam8+zskmLPU8u+Wr5uhktYm13GIeXdDy9X2+x9XbDPjL+8+ wH3vvuPTS62tGwMEfHc81S35uKx9EqvZm4Uqyozq84N3Hbgsydn4NWOOYNOS15ccc8u8jJVY ijMSDbWYi4oTAbTScbS4AgAA X-CMS-MailID: 20190124154538eucas1p2cdc2ce1eab4446e3ac139fd07d622ca7 X-Msg-Generator: CA X-RootMTR: 20190124154538eucas1p2cdc2ce1eab4446e3ac139fd07d622ca7 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190124154538eucas1p2cdc2ce1eab4446e3ac139fd07d622ca7 References: <20190124154521.13589-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 Thu Jan 24 15:45:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Konieczny X-Patchwork-Id: 10779397 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 9704891E for ; Thu, 24 Jan 2019 15:46:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 858633165A for ; Thu, 24 Jan 2019 15:46:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83D583166A; Thu, 24 Jan 2019 15:46:01 +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 00F503165A for ; Thu, 24 Jan 2019 15:46:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728700AbfAXPpy (ORCPT ); Thu, 24 Jan 2019 10:45:54 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55982 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728079AbfAXPpn (ORCPT ); Thu, 24 Jan 2019 10:45:43 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190124154541euoutp01af6d07942db4abe6917fe04bb2484f01~801bUh9v22679626796euoutp01N for ; Thu, 24 Jan 2019 15:45:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190124154541euoutp01af6d07942db4abe6917fe04bb2484f01~801bUh9v22679626796euoutp01N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1548344741; bh=bekSzHOo2GCKZ35Z2Xc2Fk5V/yJ6eHX4HVfuY/nsook=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SWJoHpXmmFBkZ2yDKSX2D16QSsvJoD6O6ry3OSfWdPiGhoYVyAe7A5XVOrhKc5JKr 36jp7nFhuqe4dien0hK0+6imSeNfGto2CgIseK+ZZPYEJ/PMORQeXsfoMmy7QNMwVD r8/nSb++bemDszZnch+6ZlfuDTVQfdwRWQ28oCeE= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190124154541eucas1p2579b51846dc71a82d036633186e2640b~801apqYDm0830008300eucas1p2T; Thu, 24 Jan 2019 15:45:41 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 2B.31.04806.4ADD94C5; Thu, 24 Jan 2019 15:45:40 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190124154540eucas1p219536f93a4b1e9133d2859e3c38c1f66~801Z4_Kb30349403494eucas1p2P; Thu, 24 Jan 2019 15:45:40 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190124154540eusmtrp2068ff0f0e1a58c780e5a2a2970b4df57~801ZqI8wI1826018260eusmtrp2v; Thu, 24 Jan 2019 15:45:40 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-ec-5c49dda4a44e Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id F3.59.04284.3ADD94C5; Thu, 24 Jan 2019 15:45:39 +0000 (GMT) Received: from AMDC3218.DIGITAL.local (unknown [106.120.51.18]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190124154539eusmtip2faf91dda7e2f8afc22b8932f35612a26~801ZFcStM2591025910eusmtip2p; Thu, 24 Jan 2019 15:45:39 +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 v3 3/3] crypto: s5p: add AES support for Exynos5433 Date: Thu, 24 Jan 2019 16:45:21 +0100 Message-Id: <20190124154521.13589-4-k.konieczny@partner.samsung.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190124154521.13589-1-k.konieczny@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGKsWRmVeSWpSXmKPExsWy7djPc7pL7nrGGKzsMbTYOGM9q8Wc8y0s Ft2vZCz69v1ntDh/fgO7xf17P5ksLu+aw2Yx4/w+Jou1R+6yW/z/1czswOWxZeVNJo9tB1Q9 Nq3qZPP4t3AKi8fBd3uYPPq2rGL0+LxJLoA9issmJTUnsyy1SN8ugSvj67ZWloJXchX7d91m a2C8IdHFyMkhIWAisXPLacYuRi4OIYEVjBLn93VDOV8YJZoafrFCOJ8ZJRoPzGDpYuQAa9l9 nwkivpxR4suTeexwHR0/v7OBzGUTMJd4tP0ME4gtIqAsMfnedGaQImaB10wSG26/AksICzhL nDs2jwXEZhFQleg7vYIdxOYVcJHY3jGTDeJAeYlpq7vA6jkFXCX2TmhmgagRlDg58wmYzQxU 07x1NtgCCYFN7BIdTa/YIZpdJPrevmCGsIUlXh3fAhWXkfi/cz4ThF0usXvrM3aI5hZGibmT F0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FVfmHmKU4GBW EuF1vegWI8SbklhZlVqUH19UmpNafIjRFOiJicxSosn5wOjOK4k3NDU0t7A0NDc2NzazUBLn PW9QGSUkkJ5YkpqdmlqQWgTTx8TBKdXAWCKbmFrxcxLDqV/634JSjvOVPZQVnaBy0VV39pYg Ecc9h2aWfgv90Hqh657Dac/1QU3v61Yen/KtlGv/NmaPZtlvuz+oT9bcGTorKDxB7KG2+bPj C9dEbt80IdSCT+XHvSOvzicfVXz2hWH/HpWrXXfOf7m3iCtbisee70Oh8aY8Z6Vr9nw5YUos xRmJhlrMRcWJAP5kMI+2AgAA X-CMS-MailID: 20190124154540eucas1p219536f93a4b1e9133d2859e3c38c1f66 X-Msg-Generator: CA X-RootMTR: 20190124154540eucas1p219536f93a4b1e9133d2859e3c38c1f66 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190124154540eucas1p219536f93a4b1e9133d2859e3c38c1f66 References: <20190124154521.13589-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. Reviewed-by: Krzysztof Kozlowski 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..3f45cc5cb94a 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; + const 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;