From patchwork Wed Jan 9 09:26:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalyani Akula X-Patchwork-Id: 10753713 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 79C81746 for ; Wed, 9 Jan 2019 09:26:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66D2828D96 for ; Wed, 9 Jan 2019 09:26:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 592CC28E53; Wed, 9 Jan 2019 09:26:54 +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 D763C28D96 for ; Wed, 9 Jan 2019 09:26:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729840AbfAIJ0s (ORCPT ); Wed, 9 Jan 2019 04:26:48 -0500 Received: from mail-eopbgr720089.outbound.protection.outlook.com ([40.107.72.89]:30752 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730112AbfAIJ0q (ORCPT ); Wed, 9 Jan 2019 04:26:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BGtqOluLi2kgFFCGn53gClLwUt5dzZrVD35awALsV54=; b=QLZT7I88R7RcSSOucWpe4mkHMlIBB9THlwbnQEkac89rYfOrLrD840LXGUc4SDm8rjsp/dV8J2ZgyMHJqau549VHSHyXEdzRd0aTb9fxxSDIQCu2irvK2dr5+HthDK9Pq5vQvLyl0uaH81zPqxPRyX2ntxyv/LZd/UIMetzxTak= Received: from DM6PR02CA0010.namprd02.prod.outlook.com (2603:10b6:5:1c::23) by SN6PR02MB4336.namprd02.prod.outlook.com (2603:10b6:805:a4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Wed, 9 Jan 2019 09:26:38 +0000 Received: from BL2NAM02FT037.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::204) by DM6PR02CA0010.outlook.office365.com (2603:10b6:5:1c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1495.6 via Frontend Transport; Wed, 9 Jan 2019 09:26:38 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT037.mail.protection.outlook.com (10.152.77.11) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1471.13 via Frontend Transport; Wed, 9 Jan 2019 09:26:36 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:51902 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1ghA8B-0000Wb-BJ; Wed, 09 Jan 2019 01:26:35 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1ghA86-0000jl-6E; Wed, 09 Jan 2019 01:26:30 -0800 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x099QS24019288; Wed, 9 Jan 2019 01:26:28 -0800 Received: from [172.23.155.90] (helo=xhdengvm155090.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1ghA84-0000iu-7s; Wed, 09 Jan 2019 01:26:28 -0800 Received: by xhdengvm155090.xilinx.com (Postfix, from userid 23151) id 5D5F58009B; Wed, 9 Jan 2019 14:56:27 +0530 (IST) From: Kalyani Akula To: , , , CC: Kalyani Akula , Sarat Chand Savitala , Kalyani Akula Subject: [RFC PATCH V2 1/4] dt-bindings: crypto: Add bindings for ZynqMP SHA3 driver Date: Wed, 9 Jan 2019 14:56:22 +0530 Message-ID: <1547025985-7228-2-git-send-email-kalyani.akula@xilinx.com> X-Mailer: git-send-email 1.9.5 In-Reply-To: <1547025985-7228-1-git-send-email-kalyani.akula@xilinx.com> References: <1547025985-7228-1-git-send-email-kalyani.akula@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(346002)(376002)(396003)(136003)(39860400002)(2980300002)(199004)(189003)(36756003)(48376002)(50466002)(8936002)(50226002)(110136005)(54906003)(106002)(81156014)(476003)(52956003)(2201001)(11346002)(446003)(26005)(6266002)(336012)(478600001)(4326008)(103686004)(2616005)(107886003)(2906002)(42186006)(16586007)(316002)(126002)(186003)(426003)(81166006)(217873002)(106466001)(76176011)(63266004)(356004)(6666004)(90966002)(36386004)(47776003)(305945005)(8676002)(486006)(51416003)(44832011)(5660300001)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR02MB4336;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT037;1:V8Cz+aeXJlTMD0as0nzIRFRaL5ffks0fi9v0bjxE3iTi3IlIcepD7MrUcWYnMfr7eQrl81t5JdlaKfW3HHUj7tiSNg4lRnhsFdWT5zR+S/o5YX/E8oejhYeReM0uPvWu MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 78cf7b94-35d0-4260-227f-08d676148e49 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4608076)(4709027)(2017052603328)(7153060);SRVR:SN6PR02MB4336; X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB4336;3:JqWaE4dq/KpY/qooPffkggN1TUs4A56qsRqCJRq6ItXQRPUShf28/xa4Gp9jekpFnWBkrSSZ67HAvREGW6zzk8V6BLQPVSvyC++8dtkYyvRsNXfNXpUGSGz+qHQAzas3f0WV7BoKP8idq38XEcy4ctBX8gGrut+xSW6E98DraG7rqRjDe1loz6ttvr/xW9x90XiMNhbfjO3B1Lvpv3wlz4ApvtKujEAfuS0v3qTKfqsrsRblwu7mR192uKeXOt/e+MqosC7FP+5oiPrMxJ8VijH9Ua2Y2QTIpdw3lIiOElXXsbb9b8YkakvmHBvqaZsYQDmVafKyRlkQNkrxMj7xfv+UH2SlaEBcSQXzQW0N9JQ3lzT+H1EivvjgdBF6iA8M;25:EI3l0WsyFzT8uNipjdCPyTmd+d2q/cE893AWAmV9lj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fZ68qUFAyJLDiapIB5BxHRZF8LMl0WILAGMlqoLtrW X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB4336;4:J8QSewr+A2DDA+24k3+/e7bI+iMkPuXQ3aNHHqJ9ZAq28u4JcvY4gmLIwTv+n+Wq3myrdPrb0/YAh/sOTnIRuRCyNBkIe4FL7mRhB/YMZ8lyULrs89gtxriaMY2ipyrhv8BekVB5WoBDVZwR9/HYdjVSWvrDy7H7gcCEryjcOskhbMrriMzt8tTIYfh9PH/vLL+YpiRN+B3Wp8keoDCAll1eZ95fO9SMPOSPD1a+9SF+AhyY3OrsIFqx01oaUOfgYpsNqJ1VpeAs/NG0+bDMw1Z+Q+sjoeJ0YIhAuiuoL28= X-Forefront-PRVS: 0912297777 X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB4336;23:2Jp39seudmi0izyVx9pudEHCDpZesSoscYKXBH5dlKCXvEO8dWiyrGtUN3cT51HpNqISBtGdOOrnbfozK0BwEEV6QZ3HM897INApyebMC4r+2+5RViNrpjE4SU0IAZWz8t09FeIIR/o0HyhxlIRGIwfU9bG3daaMQayK2ozPn3Gd8U31Fe5P5KPFaMLiwHkoNfHh+cLXYhoCjIhB2fA51gJ1MQj+co3IVeeq+Kfl+BxEeWK1Xk1BTvL6anzyGldayCMXL1WBcXq3QUoExgx3XN8taQXBJrmvvqN+f7KUPkv13m4ZIaTeWFpED3gWvreodCjSSTb7a6c/esGQNLqGzE8UKIJxR184w0TCTJtboQ+VPFNb9p9QCBnRKK8X5Z/Y9Fg7Sm4acDPv82QmmxVy1yeHIbYfI8lEjW6QG0+myH0Frs67eJh9F6lxvnNjAJHxt9pCXj/ktjxRdoslnNfmQm2Eq5a0ri3BIc5AKQ9eQjf/GzBge1iIDeysrEsuyDZHRFf4vdrV5/KWOEOxPl/6zQuoOtRXAnU7BBs02LtRGYlnuCXnozEnpZERU0WDnCVZnk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lxsyOoFmhA/lN50zc4GrlE1sma/SbskidyRolLnodGieah7k2d43/hBjW0BlxSrN6puH59tNwYRNhVZjVKf86v3CnrFZCDnUZ2wLfbgUq6mbzQ88gIeu9wMdA4NoVYoLff7jjVvJ9zurxwipHRB1MZtyyA75bMrY2Yu1jRUV+HY3/Js4i2O40w8Qwl0DMUBsUQjxRcIbuLnjitkFdJOl7/080NyxG0y6k4SoMPC+gMlfRJMgqWfKNEdNw3zwVerTXB7FN2hhatehqsf7p/PiFJOtxHvejgSVqK62QabEcrQ52iF3aWiRGk3kXyJUGd/b/UDLK+z8vokRfEkowcHuE3oZ6kqdHmVFSI5PMHtjJKMDBbqfFRvE3U+kDNOlQ/uLEuw8lcnmNcDqSdgU7mx2oDtJ8XUYF1rkWt5Kk10h67QtSNC4C2/Bdz0u9h8uE+Pvbp8iN9tog==;5:Rxty48k32ThwVjMKhMXweUD/kY8/nu/wrFax+9KEbAPOEeki52UG+S7BAy/BW1ffmEaXQoNQTqAaYQ0rGviarqE5iIuZOveUA9UBoWzzj9Oe+mAEgQF4VZXpDczqv6WQm/6Zxt+2W9+95ir+tydLkVWDmI1/egy3GKKUYkQtNwnkuJ48e6fr47+EqnWcz6zpO+sntUHYjvjyOrfG9cm+HA==;7:ChNHSbmQiZJWuY4XNYrLDF8Qk08y4PhqFbY0b7nWcpMJJoStBvt9FKOmRZSYHeqexY7KG6xII/r7jWLDisY2R0kHqS6BXRUPagtx5a7g34UAPpIzo8BYzhIC5hplEjrsVump2FL50M5fovTa9dQH6Q== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2019 09:26:36.2459 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78cf7b94-35d0-4260-227f-08d676148e49 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB4336 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 documentation to describe Xilinx ZynqMP SHA3 driver bindings. Signed-off-by: Kalyani Akula --- .../devicetree/bindings/crypto/zynqmp-sha.txt | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/crypto/zynqmp-sha.txt diff --git a/Documentation/devicetree/bindings/crypto/zynqmp-sha.txt b/Documentation/devicetree/bindings/crypto/zynqmp-sha.txt new file mode 100644 index 0000000..c7be6e2 --- /dev/null +++ b/Documentation/devicetree/bindings/crypto/zynqmp-sha.txt @@ -0,0 +1,12 @@ +Xilinx ZynqMP SHA3(keccak-384) hw acceleration support. + +The ZynqMp PS-SHA hw accelerator is used to calculate the +SHA3(keccak-384) hash value on the given user data. + +Required properties: +- compatible: should contain "xlnx,zynqmp-keccak-384" + +Example: + xlnx_keccak_384: sha384 { + compatible = "xlnx,zynqmp-keccak-384"; + }; From patchwork Wed Jan 9 09:26:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalyani Akula X-Patchwork-Id: 10753717 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 10A8914E5 for ; Wed, 9 Jan 2019 09:27:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0078928D96 for ; Wed, 9 Jan 2019 09:27:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E835B28E53; Wed, 9 Jan 2019 09:27:05 +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 C80AA28D96 for ; Wed, 9 Jan 2019 09:27:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730338AbfAIJ05 (ORCPT ); Wed, 9 Jan 2019 04:26:57 -0500 Received: from mail-eopbgr770055.outbound.protection.outlook.com ([40.107.77.55]:8155 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729686AbfAIJ05 (ORCPT ); Wed, 9 Jan 2019 04:26:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Al1+5ZDCmqYuUgMFkT9gF+ZHEX75an7ZSf9ba8tJY+8=; b=WOSheXtO80fzcXgEFxUHRTLQflmbGpZ3nOObZd4tpON/SEzqt/lIz9hX6M+z50k4LIhq20Kx/qIcaYbhASTmKlKbXQfeuUadHw7dnWr2To+5ow9TAV2Su6OVulSYA9C7lyKGF6ZChSHaDASJTz1pYtJeMRmgWKr59MjvAppOEuw= Received: from SN4PR0201CA0054.namprd02.prod.outlook.com (2603:10b6:803:20::16) by MWHPR0201MB3516.namprd02.prod.outlook.com (2603:10b6:301:77::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Wed, 9 Jan 2019 09:26:38 +0000 Received: from BL2NAM02FT049.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::201) by SN4PR0201CA0054.outlook.office365.com (2603:10b6:803:20::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1516.14 via Frontend Transport; Wed, 9 Jan 2019 09:26:38 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT049.mail.protection.outlook.com (10.152.77.118) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1471.13 via Frontend Transport; Wed, 9 Jan 2019 09:26:36 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:51891 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1ghA8B-0000WZ-3m; Wed, 09 Jan 2019 01:26:35 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1ghA86-0000jl-0O; Wed, 09 Jan 2019 01:26:30 -0800 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x099QSPA028521; Wed, 9 Jan 2019 01:26:28 -0800 Received: from [172.23.155.90] (helo=xhdengvm155090.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1ghA84-0000iv-8A; Wed, 09 Jan 2019 01:26:28 -0800 Received: by xhdengvm155090.xilinx.com (Postfix, from userid 23151) id 606C5800EB; Wed, 9 Jan 2019 14:56:27 +0530 (IST) From: Kalyani Akula To: , , , CC: Kalyani Akula , Sarat Chand Savitala , Kalyani Akula Subject: [RFC PATCH V2 2/4] firmware: xilinx: Add ZynqMP sha_hash API for SHA3 functionality Date: Wed, 9 Jan 2019 14:56:23 +0530 Message-ID: <1547025985-7228-3-git-send-email-kalyani.akula@xilinx.com> X-Mailer: git-send-email 1.9.5 In-Reply-To: <1547025985-7228-1-git-send-email-kalyani.akula@xilinx.com> References: <1547025985-7228-1-git-send-email-kalyani.akula@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(376002)(346002)(39860400002)(396003)(2980300002)(199004)(189003)(305945005)(486006)(63266004)(4326008)(50466002)(44832011)(316002)(47776003)(106466001)(5660300001)(42186006)(356004)(6666004)(14444005)(126002)(217873002)(11346002)(51416003)(76176011)(2201001)(26005)(52956003)(336012)(186003)(446003)(426003)(2616005)(106002)(81166006)(48376002)(50226002)(8936002)(476003)(2906002)(478600001)(110136005)(16586007)(54906003)(36386004)(81156014)(6266002)(103686004)(36756003)(107886003)(90966002)(8676002)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR0201MB3516;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT049;1:cjvH/JWlpHdT+3pFuRINBkAk8SCUZm9Uyx78c1H3o/PmZ/P7Ks0DZw+yqJ4XICgGWPwXMlpGYz4mCn3KPQ+JhmUYB8wHj1/0AFKcyP2OYNrD9al00LVp29M0ZW2GIwOV MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b8934132-f26d-4e58-fb44-08d676148e32 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4608076)(4709027)(2017052603328)(7153060);SRVR:MWHPR0201MB3516; X-Microsoft-Exchange-Diagnostics: 1;MWHPR0201MB3516;3:JDDSUa2TN/6vOdRa7NLOGbo4l3pjOcBoFA3MRHLX0X7VuJCpNGS8cJnF02lQooTdVFQqptEzSK366y4nrj5yh9Qdp/drf6TmRz+bAg1iIQ/XV2x7qK4iJuOSBS4/xGGip5P+etE2JQD1XE0A8i9ePzDdVOYoBe3Q0V2KBoBfaPzNXlIkx3BM/i+IS5i82dk9myHNSSGLXHhZey11G7JecVkKkoTUowj8cae6czuDvrDwiW1khcKtl6Sg9J0fwxCrlKdiy3L0s4k0R6saDgHw8eYp8Ueoa/8NLW8YwkqnyoNYrs8D0QAeSQcAoW+/qyjpEFKnqlnoITbD8gJ3fFIUDmL8WHFkBHEfHNHq5gMFso5z6E00ZWB4zKnBpZ7YWogO;25:ndaGYPr213PtSmel8tShQ6Kk5HdmmvX4L6Nmc07XqXrxoD21zY6lp7MbzMS8X4PsifFZluvwbiZ1+pNSMLInraWoXCMbpOND/pUrsITEJdnoYQGUZnU3ibHTGsemGDYq3RfacRidVZG3Yw0wVq8taveWEsHTVkk4pWNnNX7GiTvMq/r9qM7VF0Kq7sGOCfFktXnaO03PlaM737r1a8Ffi/F+NIJsdFuUpNebZq+nq/FDzsq1p9pMhq0tpx7nlcCBc8MACIu6fVYRGWzbzj8AtlQSAK37F3EHX9vGy1ZGLFG2JQY/iMHP31LLerLvv4EQzPDNfBKxbmhUkvRWC1yXUQ== X-MS-TrafficTypeDiagnostic: MWHPR0201MB3516: X-Micro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mrRESSS7Cel4ZGpkB7N0FmuRQQ+K5AxWXyH8mZdZ2ZJjPAQXJ6VLgO+I32PABUNiCLY4ycfieMzBJmGBrPve+xqyfZEVva0qg38WexlkcC7saphFoNwUuyo9rMsEMfUZi2Z0zupJSUM3WtcDHMBtNWk/3gcV5DXprw==;5:7DxhMR5w7Spje/7N/uqbMSqv5aTkwaBSgmTiMt6Qo1n8gCHDqcti/rZAWffpbuIvH/gcf+emL0JMqlEtu0ieEJe4uMP1OJHf8jGphmhkuIJjs84ZltCFxXzUp4j0m7zBWI+5CS8aDsMABGAYNfwH2Aj6y8q+TdO5QnHw3EK/rIymyLzFVkuCUkMKNlu0mEv9e8vU4DS3Gho5VUbsiaL29g==;7:ypUm0vNmgfZnWeJ+/o8tyFpHPXEWC7Y/po/1O60XPvqfGqYaF1WodkW1CGbihW56R43gNDcuVdbrm7NLNl7OfG1yT3GsuME+XPZzNK3v85bpZ37mO0wZ3fJzr50UuWnrmn6AAQXzqgeJy6sFXSnK0Q== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2019 09:26:36.0226 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8934132-f26d-4e58-fb44-08d676148e32 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0201MB3516 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 ZynqMP firmware SHA_HASH API to compute SHA3 hash of given data. Signed-off-by: Kalyani Akula --- drivers/firmware/xilinx/zynqmp.c | 27 +++++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 2 ++ 2 files changed, 29 insertions(+), 0 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 9a1c72a..c51ecce 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -469,8 +469,35 @@ static int zynqmp_pm_ioctl(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, arg1, arg2, out); } +/** + * zynqmp_pm_sha_hash - Access the SHA engine to calculate the hash + * @address: Address of the data/ Address of output buffer where + * hash should be stored. + * @size: Size of the data. + * @flags: + * BIT(0) - for initializing csudma driver and SHA3(Here address + * and size inputs can be NULL). + * BIT(1) - to call Sha3_Update API which can be called multiple + * times when data is not contiguous. + * BIT(2) - to get final hash of the whole updated data. + * Hash will be overwritten at provided address with + * 48 bytes. + * + * Return: Returns status, either success or error code. + */ +static int zynqmp_pm_sha_hash(const u64 address, const u32 size, + const u32 flags) +{ + u32 lower_32_bits = (u32)address; + u32 upper_32_bits = (u32)(address >> 32); + + return zynqmp_pm_invoke_fn(PM_SECURE_SHA, upper_32_bits, lower_32_bits, + size, flags, NULL); +} + static const struct zynqmp_eemi_ops eemi_ops = { .get_api_version = zynqmp_pm_get_api_version, + .sha_hash = zynqmp_pm_sha_hash, .query_data = zynqmp_pm_query_data, .clock_enable = zynqmp_pm_clock_enable, .clock_disable = zynqmp_pm_clock_disable, diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 3c3c28e..72ffe09 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -34,6 +34,7 @@ enum pm_api_id { PM_GET_API_VERSION = 1, + PM_SECURE_SHA = 26, PM_IOCTL = 34, PM_QUERY_DATA, PM_CLOCK_ENABLE, @@ -102,6 +103,7 @@ struct zynqmp_eemi_ops { int (*clock_setparent)(u32 clock_id, u32 parent_id); int (*clock_getparent)(u32 clock_id, u32 *parent_id); int (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out); + int (*sha_hash)(const u64 address, const u32 size, const u32 flags); }; #if IS_REACHABLE(CONFIG_ARCH_ZYNQMP) From patchwork Wed Jan 9 09:26:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalyani Akula X-Patchwork-Id: 10753719 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 5A0D414E5 for ; Wed, 9 Jan 2019 09:27:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4929128D96 for ; Wed, 9 Jan 2019 09:27:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D2FA28E53; Wed, 9 Jan 2019 09:27: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 67E5028D96 for ; Wed, 9 Jan 2019 09:27:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730268AbfAIJ0z (ORCPT ); Wed, 9 Jan 2019 04:26:55 -0500 Received: from mail-eopbgr750071.outbound.protection.outlook.com ([40.107.75.71]:34304 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728138AbfAIJ0o (ORCPT ); Wed, 9 Jan 2019 04:26:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gGRSmbpqn2qXUwZsO5NDYwjJXEl9up7pXrJ1pOCMA9M=; b=zUuLhs05+R4qKruqK7/cJf+c8H5qycalQwQslNR9nmmUzXia1qkci1djRKI14NXUyokS15fxcVsG9jFW/IwU/fCiqQuM1yGZAkyG/GhwfUYbWYCnWc33rw93a0RCMkAB+Bs0iWoJDvfoxhjCoUfuRZUg0lvlEx+k4DowrT6/DCM= Received: from MWHPR02CA0035.namprd02.prod.outlook.com (2603:10b6:301:60::24) by DM6PR02MB4330.namprd02.prod.outlook.com (2603:10b6:5:2a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Wed, 9 Jan 2019 09:26:36 +0000 Received: from CY1NAM02FT014.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::205) by MWHPR02CA0035.outlook.office365.com (2603:10b6:301:60::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1495.7 via Frontend Transport; Wed, 9 Jan 2019 09:26:35 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT014.mail.protection.outlook.com (10.152.75.142) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1471.13 via Frontend Transport; Wed, 9 Jan 2019 09:26:35 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:51884 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1ghA8B-0000WX-0W; Wed, 09 Jan 2019 01:26:35 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1ghA85-0000jl-RA; Wed, 09 Jan 2019 01:26:29 -0800 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x099QSGj019294; Wed, 9 Jan 2019 01:26:29 -0800 Received: from [172.23.155.90] (helo=xhdengvm155090.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1ghA84-0000iw-8g; Wed, 09 Jan 2019 01:26:28 -0800 Received: by xhdengvm155090.xilinx.com (Postfix, from userid 23151) id 639A8800EC; Wed, 9 Jan 2019 14:56:27 +0530 (IST) From: Kalyani Akula To: , , , CC: Kalyani Akula , Sarat Chand Savitala , Kalyani Akula Subject: [RFC PATCH V2 3/4] crypto: Add Xilinx SHA3 driver Date: Wed, 9 Jan 2019 14:56:24 +0530 Message-ID: <1547025985-7228-4-git-send-email-kalyani.akula@xilinx.com> X-Mailer: git-send-email 1.9.5 In-Reply-To: <1547025985-7228-1-git-send-email-kalyani.akula@xilinx.com> References: <1547025985-7228-1-git-send-email-kalyani.akula@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(136003)(396003)(376002)(346002)(2980300002)(199004)(189003)(2201001)(90966002)(54906003)(316002)(110136005)(42186006)(16586007)(81166006)(52956003)(106002)(81156014)(478600001)(336012)(106466001)(6666004)(103686004)(2616005)(305945005)(356004)(126002)(107886003)(426003)(8676002)(6266002)(476003)(8936002)(4326008)(50226002)(63266004)(446003)(11346002)(186003)(36386004)(26005)(14444005)(217873002)(36756003)(51416003)(76176011)(5660300001)(47776003)(48376002)(50466002)(486006)(44832011)(2906002)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR02MB4330;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CY1NAM02FT014;1:gFzo1ogfTKYSSG0wyUUjAy0Vm84lqzPobgYiEfApVDhnyJDEHRrpMW9RHWk/IS+RTM+6oHHoJ5hxe/WExylJRCm6+MQ14SbYiph5NIx7moDif+EiX05FKga/ldIWBlp1 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33c4032c-1afe-4dec-05e6-08d676148d13 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600109)(711020)(4608076)(4709027)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:DM6PR02MB4330; X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4330;3:YusPrhim77WP3iUYXerRZFeS5uGY0JepXWsxBC6xwha6/LNRpOcz++RCLV+ua0q9F90RUivN/0ohwgngrj94pUMKqLPWHGXgfI6JW6S3NUAZfihcxBptc1A6Y+DZ47E2taoAwzWdKz36986mKbfhN06FjX9x/rGpFo91iPO4vOX+aWPnyNZqxS09AMbEjsj5AspnYLj0Ibc+PKWq9oqmI5hF9oe4ZF6m8EXliuTyxRaegTWlJtJ3UzIVxFx2FjQLH+rQ/u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YfgA0o9ptVSD0jQl16FC+9WXU5Lp0OPYmHCs+pd98DDLRyq0iNFeQiE+cMHB8lSELQFaMUPzJkl3wKyguMoP5bdYH+phjBPQMfe5coM7Y7+XFJnUur+MroRFqDLDmD456Fs57JOvlJ7BytRmPK0i05iyjFa9cW3LuC3286zjVScrz+lJSZCTmR8nSMyHqmBTDaAL+8b/2bqDU X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4330;4:pi0JyQMHyjsuWH+ClJH27exV2/WbA6dkqqSFxmqAxJ8symydUsYm1KLC/QL0WikMOQ3BF6dWpCmVjDZSAsYFwVc/oVtrehcqPB/GkCTda+6ElmCWriivPx48IpeDlP3pTN4pockiw/BWSM+cJSYoAy+T/5xowoaPQTuMbfA9y6bapjcwcnvVN4ezdyc09+WEkUmaUaszxVQ1dKVaNNXHk/bwZfvKNC4dCdCo0hAEBCPBu9FVpnPvYK7hSbg+Aj8s5D0CTJfMGJGQYkFot8mZ5c6348pgwNkQxGzUOAC/q5NXzb8mbbKnmLniW2EBYUPr X-Forefront-PRVS: 0912297777 X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4330;23:IzSqj8DRqIiFmogC9V9W0QyrwaWVCVrFhvf+V7PozqrMRVKIoXsI48YKu8qpZsoZcq4965qkKJg20bKRuS0M41hLt5k31JKYpF8F91NNOGA8atyHAheBJgE4DERFUIIRGv7e7fBdTXn9N3QsyoxSp7wVLjKcEzejQDzBrM9l5dUj+TXr99dMwvzLDErwfBDnkGYjmtFvaCFnG1Gux7E/kI4fG4bkpcKIn8nJ0u3NRH62E7IvnEMobnw7sqfyq1hnX+zuVDAZBKVGwVrvmrhn7TkrLYaHMeFwI5t2jbmW6DzUoQmxauGmcXVjyh5+jqmXkp78PRbci8lcIv8g032O13D9A8nWxfGS3vs3MoQVbV0mxe3oNJBcVw288Fqng2LWmqnx0IKYM29nq5Hj6RaKIy+Xk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.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2019 09:26:35.4948 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33c4032c-1afe-4dec-05e6-08d676148d13 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4330 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 This patch adds SHA3 driver support for the Xilinx ZynqMP SoC. Signed-off-by: Kalyani Akula --- drivers/crypto/Kconfig | 10 ++ drivers/crypto/Makefile | 1 + drivers/crypto/zynqmp-sha.c | 305 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 316 insertions(+), 0 deletions(-) create mode 100644 drivers/crypto/zynqmp-sha.c diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 5a90075..b723e23 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -667,6 +667,16 @@ config CRYPTO_DEV_ROCKCHIP This driver interfaces with the hardware crypto accelerator. Supporting cbc/ecb chainmode, and aes/des/des3_ede cipher mode. +config CRYPTO_DEV_ZYNQMP_SHA3 + tristate "Support for Xilinx ZynqMP SHA3 hw accelerator" + depends on ARCH_ZYNQMP || COMPILE_TEST + select CRYPTO_HASH + help + Xilinx ZynqMP has SHA3 engine used for secure hash calculation. + This driver interfaces with SHA3 hw engine. + Select this if you want to use the ZynqMP module + for SHA3 hash computation. + config CRYPTO_DEV_MEDIATEK tristate "MediaTek's EIP97 Cryptographic Engine driver" depends on (ARM && ARCH_MEDIATEK) || COMPILE_TEST diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile index 8e7e225..64c29fe 100644 --- a/drivers/crypto/Makefile +++ b/drivers/crypto/Makefile @@ -47,3 +47,4 @@ obj-$(CONFIG_CRYPTO_DEV_BCM_SPU) += bcm/ obj-$(CONFIG_CRYPTO_DEV_SAFEXCEL) += inside-secure/ obj-$(CONFIG_CRYPTO_DEV_ARTPEC6) += axis/ obj-y += hisilicon/ +obj-$(CONFIG_CRYPTO_DEV_ZYNQMP_SHA3) += zynqmp-sha.o diff --git a/drivers/crypto/zynqmp-sha.c b/drivers/crypto/zynqmp-sha.c new file mode 100644 index 0000000..56e83cf --- /dev/null +++ b/drivers/crypto/zynqmp-sha.c @@ -0,0 +1,305 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Cryptographic API. + * + * Support for Xilinx ZynqMP SHA3 HW Acceleration. + * + * Copyright (c) 2018 Xilinx Inc. + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ZYNQMP_SHA3_INIT 1 +#define ZYNQMP_SHA3_UPDATE 2 +#define ZYNQMP_SHA3_FINAL 4 + +#define ZYNQMP_SHA_QUEUE_LENGTH 1 + +struct zynqmp_sha_dev; + +/* + * .statesize = sizeof(struct zynqmp_sha_reqctx) must be <= PAGE_SIZE / 8 as + * tested by the ahash_prepare_alg() function. + */ +struct zynqmp_sha_reqctx { + struct zynqmp_sha_dev *dd; + unsigned long flags; +}; + +struct zynqmp_sha_ctx { + struct zynqmp_sha_dev *dd; + unsigned long flags; +}; + +struct zynqmp_sha_dev { + struct list_head list; + struct device *dev; + /* the lock protects queue and dev list*/ + spinlock_t lock; + int err; + + unsigned long flags; + struct crypto_queue queue; + struct ahash_request *req; +}; + +struct zynqmp_sha_drv { + struct list_head dev_list; + /* the lock protects dev list*/ + spinlock_t lock; +}; + +static struct zynqmp_sha_drv zynqmp_sha = { + .dev_list = LIST_HEAD_INIT(zynqmp_sha.dev_list), + .lock = __SPIN_LOCK_UNLOCKED(zynqmp_sha.lock), +}; + +static int zynqmp_sha_init(struct ahash_request *req) +{ + const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); + struct zynqmp_sha_reqctx *ctx = ahash_request_ctx(req); + struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); + struct zynqmp_sha_ctx *tctx = crypto_ahash_ctx(tfm); + struct zynqmp_sha_dev *dd = NULL; + struct zynqmp_sha_dev *tmp; + int ret; + + if (!eemi_ops || !eemi_ops->sha_hash) + return -ENOTSUPP; + + spin_lock_bh(&zynqmp_sha.lock); + if (!tctx->dd) { + list_for_each_entry(tmp, &zynqmp_sha.dev_list, list) { + dd = tmp; + break; + } + tctx->dd = dd; + } else { + dd = tctx->dd; + } + spin_unlock_bh(&zynqmp_sha.lock); + + ctx->dd = dd; + dev_dbg(dd->dev, "init: digest size: %d\n", + crypto_ahash_digestsize(tfm)); + + ret = eemi_ops->sha_hash(0, 0, ZYNQMP_SHA3_INIT); + + return ret; +} + +static int zynqmp_sha_update(struct ahash_request *req) +{ + const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); + struct zynqmp_sha_ctx *tctx = crypto_tfm_ctx(req->base.tfm); + struct zynqmp_sha_dev *dd = tctx->dd; + size_t dma_size = req->nbytes; + dma_addr_t dma_addr; + char *kbuf; + int ret; + + if (!req->nbytes) + return 0; + + if (!eemi_ops || !eemi_ops->sha_hash) + return -ENOTSUPP; + + kbuf = dma_alloc_coherent(dd->dev, dma_size, &dma_addr, GFP_KERNEL); + if (!kbuf) + return -ENOMEM; + + scatterwalk_map_and_copy(kbuf, req->src, 0, req->nbytes, 0); + __flush_cache_user_range((unsigned long)kbuf, + (unsigned long)kbuf + dma_size); + ret = eemi_ops->sha_hash(dma_addr, req->nbytes, ZYNQMP_SHA3_UPDATE); + dma_free_coherent(dd->dev, dma_size, kbuf, dma_addr); + + return ret; +} + +static int zynqmp_sha_final(struct ahash_request *req) +{ + const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); + struct zynqmp_sha_ctx *tctx = crypto_tfm_ctx(req->base.tfm); + struct zynqmp_sha_dev *dd = tctx->dd; + size_t dma_size = SHA384_DIGEST_SIZE; + dma_addr_t dma_addr; + char *kbuf; + int ret; + + if (!eemi_ops || !eemi_ops->sha_hash) + return -ENOTSUPP; + + kbuf = dma_alloc_coherent(dd->dev, dma_size, &dma_addr, GFP_KERNEL); + if (!kbuf) + return -ENOMEM; + + ret = eemi_ops->sha_hash(dma_addr, dma_size, ZYNQMP_SHA3_FINAL); + memcpy(req->result, kbuf, SHA384_DIGEST_SIZE); + dma_free_coherent(dd->dev, dma_size, kbuf, dma_addr); + + return ret; +} + +static int zynqmp_sha_finup(struct ahash_request *req) +{ + zynqmp_sha_update(req); + zynqmp_sha_final(req); + + return 0; +} + +static int zynqmp_sha_digest(struct ahash_request *req) +{ + zynqmp_sha_init(req); + zynqmp_sha_update(req); + zynqmp_sha_final(req); + + return 0; +} + +static int zynqmp_sha_export(struct ahash_request *req, void *out) +{ + const struct zynqmp_sha_reqctx *ctx = ahash_request_ctx(req); + + memcpy(out, ctx, sizeof(*ctx)); + return 0; +} + +static int zynqmp_sha_import(struct ahash_request *req, const void *in) +{ + struct zynqmp_sha_reqctx *ctx = ahash_request_ctx(req); + + memcpy(ctx, in, sizeof(*ctx)); + return 0; +} + +static int zynqmp_sha_cra_init(struct crypto_tfm *tfm) +{ + crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), + sizeof(struct zynqmp_sha_reqctx)); + + return 0; +} + +static struct ahash_alg sha3_alg = { + .init = zynqmp_sha_init, + .update = zynqmp_sha_update, + .final = zynqmp_sha_final, + .finup = zynqmp_sha_finup, + .digest = zynqmp_sha_digest, + .export = zynqmp_sha_export, + .import = zynqmp_sha_import, + .halg = { + .digestsize = SHA384_DIGEST_SIZE, + .statesize = sizeof(struct sha256_state), + .base = { + .cra_name = "xilinx-keccak-384", + .cra_driver_name = "zynqmp-keccak-384", + .cra_priority = 300, + .cra_flags = CRYPTO_ALG_ASYNC, + .cra_blocksize = SHA384_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct zynqmp_sha_ctx), + .cra_alignmask = 0, + .cra_module = THIS_MODULE, + .cra_init = zynqmp_sha_cra_init, + } + } +}; + +static const struct of_device_id zynqmp_sha_dt_ids[] = { + { .compatible = "xlnx,zynqmp-keccak-384" }, + { /* sentinel */ } +}; + +MODULE_DEVICE_TABLE(of, zynqmp_sha_dt_ids); + +static int zynqmp_sha_probe(struct platform_device *pdev) +{ + struct zynqmp_sha_dev *sha_dd; + struct device *dev = &pdev->dev; + int err; + + sha_dd = devm_kzalloc(&pdev->dev, sizeof(*sha_dd), GFP_KERNEL); + if (!sha_dd) + return -ENOMEM; + + sha_dd->dev = dev; + platform_set_drvdata(pdev, sha_dd); + INIT_LIST_HEAD(&sha_dd->list); + spin_lock_init(&sha_dd->lock); + crypto_init_queue(&sha_dd->queue, ZYNQMP_SHA_QUEUE_LENGTH); + spin_lock(&zynqmp_sha.lock); + list_add_tail(&sha_dd->list, &zynqmp_sha.dev_list); + spin_unlock(&zynqmp_sha.lock); + + err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(44)); + if (err < 0) { + dev_err(dev, "no usable DMA configuration"); + goto err_algs; + } + + err = crypto_register_ahash(&sha3_alg); + if (err) + goto err_algs; + + return 0; + +err_algs: + spin_lock(&zynqmp_sha.lock); + list_del(&sha_dd->list); + spin_unlock(&zynqmp_sha.lock); + dev_err(dev, "initialization failed.\n"); + + return err; +} + +static int zynqmp_sha_remove(struct platform_device *pdev) +{ + static struct zynqmp_sha_dev *sha_dd; + + sha_dd = platform_get_drvdata(pdev); + + if (!sha_dd) + return -ENODEV; + + spin_lock(&zynqmp_sha.lock); + list_del(&sha_dd->list); + spin_unlock(&zynqmp_sha.lock); + + crypto_unregister_ahash(&sha3_alg); + + return 0; +} + +static struct platform_driver zynqmp_sha_driver = { + .probe = zynqmp_sha_probe, + .remove = zynqmp_sha_remove, + .driver = { + .name = "zynqmp-keccak-384", + .of_match_table = of_match_ptr(zynqmp_sha_dt_ids), + }, +}; + +module_platform_driver(zynqmp_sha_driver); + +MODULE_DESCRIPTION("ZynqMP SHA3 hw acceleration support."); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Nava kishore Manne "); From patchwork Wed Jan 9 09:26:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalyani Akula X-Patchwork-Id: 10753723 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 9730914E5 for ; Wed, 9 Jan 2019 09:27:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87C2128D96 for ; Wed, 9 Jan 2019 09:27:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C2B028E53; Wed, 9 Jan 2019 09:27:14 +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 E746928D96 for ; Wed, 9 Jan 2019 09:27:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729789AbfAIJ0n (ORCPT ); Wed, 9 Jan 2019 04:26:43 -0500 Received: from mail-eopbgr750054.outbound.protection.outlook.com ([40.107.75.54]:64635 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729402AbfAIJ0n (ORCPT ); Wed, 9 Jan 2019 04:26:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Bh9FSX7gtLcsB+UuG70niE79iyBO0SnAXeS0QFECQHY=; b=1DRDWPJM95xGERhVrzzca9zeyYvg6CBymQsM+8vVXBtpso/3TLCcQY8oQSCXn8tNGftUwspB3HLeAUv53/B+xhgF441kJPOdt/JwxJczGSXP3vz7zSmGlKD1YRC28ooGuB70rgesWnkUxbJ8dHdQO4hij4RmhNLwoha2BzFP7aQ= Received: from BL0PR02CA0051.namprd02.prod.outlook.com (2603:10b6:207:3d::28) by BL0PR02MB4449.namprd02.prod.outlook.com (2603:10b6:208:45::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.8; Wed, 9 Jan 2019 09:26:38 +0000 Received: from CY1NAM02FT015.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::209) by BL0PR02CA0051.outlook.office365.com (2603:10b6:207:3d::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1495.7 via Frontend Transport; Wed, 9 Jan 2019 09:26:37 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT015.mail.protection.outlook.com (10.152.75.146) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1471.13 via Frontend Transport; Wed, 9 Jan 2019 09:26:35 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:51888 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1ghA8B-0000WY-2D; Wed, 09 Jan 2019 01:26:35 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1ghA85-0000jl-V1; Wed, 09 Jan 2019 01:26:30 -0800 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x099QSAo019292; Wed, 9 Jan 2019 01:26:28 -0800 Received: from [172.23.155.90] (helo=xhdengvm155090.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1ghA84-0000ix-9E; Wed, 09 Jan 2019 01:26:28 -0800 Received: by xhdengvm155090.xilinx.com (Postfix, from userid 23151) id 672EE800ED; Wed, 9 Jan 2019 14:56:27 +0530 (IST) From: Kalyani Akula To: , , , CC: Kalyani Akula , Sarat Chand Savitala , Kalyani Akula Subject: [RFC PATCH V2 4/4] ARM64: zynqmp: Add Xilinix SHA-384 node. Date: Wed, 9 Jan 2019 14:56:25 +0530 Message-ID: <1547025985-7228-5-git-send-email-kalyani.akula@xilinx.com> X-Mailer: git-send-email 1.9.5 In-Reply-To: <1547025985-7228-1-git-send-email-kalyani.akula@xilinx.com> References: <1547025985-7228-1-git-send-email-kalyani.akula@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(346002)(376002)(396003)(136003)(39860400002)(2980300002)(199004)(189003)(486006)(8936002)(6266002)(16586007)(316002)(90966002)(107886003)(110136005)(42186006)(81156014)(81166006)(54906003)(478600001)(44832011)(4326008)(50226002)(103686004)(106466001)(47776003)(36386004)(2906002)(5660300001)(63266004)(186003)(76176011)(305945005)(52956003)(26005)(2201001)(51416003)(11346002)(217873002)(446003)(476003)(126002)(2616005)(106002)(8676002)(426003)(36756003)(336012)(48376002)(356004)(50466002)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR02MB4449;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CY1NAM02FT015;1:T/jeXkcW8aWW48cy31r9+6SbvPZvZ6O/8uH32xjtp3SgCKM0VJS3Jq0MK6CBHZH9hl519Fj+hrXRm1VDXTLQ63SjkWuuWeOm4nK7Wzf2pukc0K5IxJ2S8PJ0vJO6dGTZ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 87958538-9552-46d6-c64c-08d676148e04 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4608076)(4709027)(2017052603328)(7153060);SRVR:BL0PR02MB4449; X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4449;3:sUnrhs2ZPaM2aaWvS7LmqLP2rSlvVowXVFlluOxqt1a/F0jOrhVtuwyqz4bgX69MLjYCGHl5dbME+cod1gv9ruJJ4tvGSXRMoNccWE23jMYKOicjCucezflQOKZmczXcIQzoHAwYndtv7Oc8NRJvOmloIzbXexGP7tXWcOcQULJq/7W8wYnxPezjX2k2KZZ1g15offrYGUXJ9ZsUagIWlHgy3sfX88hv7Ipjpvw6nWuw+oNqVw3bmErxr70nHzMazLZ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iSRsUNogfY9WyR9XTd+u4IUkFANGRZALe6+sGikLYxsPEND14l5YpMKXqqF+yHuUtFFUqNa9x8g6hM3mfP2QpmH1LBLbrglZ1Pbq//RPUe5eNH15aPq3KLTWseiJDRQV5d7zWlSfCCeRCcKAAU8TFMcGbZsvINQlC3MZmkb1sX1kYuy+shW3sQgJ0duysMcM/tTbfZVek9SqR91FJXTFGRJES X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4449;4:s79TstQ8cBZn9STIsES8jiR6TdU22sCbi7OKe6qsPplK8FLu7WNB4yADm2yvj6MK7zg6L6LWutGD3h3GFV4AwJfj81iTihrnpZxy+Sn2gMqMb3BIqDmpwg22pyN4TrpOLQh9liqwQ4D/Tas+OmvjKpwtmPlWiZgAj3njBRoK1jn2/fvtCYazWLFQCBkgVaTaE/W1jwRiY4EmRodqrHii9K9+UL/6yfiuoy47WIANvK20TrEuxJYstprbnXA1aoj23m92+odEZ4vd4EGr/AySALo0HJLF9Ot214V0UwL3RavrbRL5mix01WkfPCL2ECUW X-Forefront-PRVS: 0912297777 X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4449;23:vQrV1aUfsXl/PwqrU+IbtdJxb2qA4ar3FgjQj+kLk2Tyi8ZM4B3Zyun2GzzcI5Xhd8Fn+b6XgUVrTg3WsV9G3oc9wHBEp7lVCAv4ulGRlx/zJJOlEBz3xOY/y6vqnY5kqCpUQ0spvAs9wPgVVSj8drRMS0EVjD+MAnBPSF2IJxinLYC4pc0YbnuR3qOy+JTpkC0uTwNX7MEoiEuxJJMQoedvDr4MLbwA6z+Ua7NOCO1tTKSVcIK6toHoSH0KwnHbdIazkOyHsoQvN/swj4P3EoJ9uf3y0s0bhmCkAZ9ZfghSCyPFRZfjBzeskcRxvwfPTWsmzDR6eRH4ZgyLWhOqg2eFVO7ngXG8GUibrhHvTyIALGLDXbQDyrONqPDeE1GfuT+y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oQv99UZva9mprF+oT3Em9urYXmCuLCSKnMagpnGzhVKmkQktroSmgdb+qxhEyOv/5iw0gnWFOTVhTQRYycw32ZUPT8hq5P+5BVXNi3pw8o X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4449;6:fvWo/k4xgYGG1kUP2utQlUXkJESvofCcz/7vfRfYNZJIwwAbbzA0+V4bbjaKqsBaCcxl9QaLdNqg/OSSSIOYre3rlbHbDq0SnOGommGJ/Zc3ISCxJeXZDgfY0+QDmoMiNX2KF4FxnedJVC4Gh0bR4nVPPg460HdZIYeP4FdPZCFpAmO412EmrrBwJOIuE/k4tIi+fOn+5xJztP+M/oXbNlNPr6hA8BovFAzvXQS5IKDLhCO+f2Z6XR38tUgbXCSDpbMOVl6ArTJ1GGPqCoyh5um/PndB+vf8RyEJbv4td1+xmunLUqIYLHd4hal9VZruUFcMF2xpKE7nEgLGQItYywsgzIRYRhWxdbIXOxHV8ltIv8cIy69RM54O9aCfZffjbOpNWE14vCO7Ai00nw7cimMXi91kPcxD+FXBjPOkmUZ0BqYgtflaJitq85TKXn+9IxGzjA6+EcQ8ujxgRa0Gxg==;5:ru3NQrtCZVEUcpf6Fr2b5a/fwPiO1HmYc8cisNxBM6hGFtlG0GGbSZBhi4o/VM/xervXgO4V14PMlkYGCRJ0IPcMeIpI1BAdLwMTApddT3sulkEflcleu3/ITN4Lb1Vx73Bmb8YQu26ij9byS2DtBZMRUYJAunK+oPJWjr2Rjo1zI6n6FLhOOn7vlR5A5KsNT/eUV1NbkOnzr7giVS9aXg==;7:eRttEehK5QU4ZSV48DwyUkwPuqiR36Mfw3X+44JVDIHMSbFn/Sv6oJcSlAQqbHye7U3A4akhUgy8N4kXgseS8x1bn/ufhgrh/16SXGhuF6OobuY/zLRPt0n5J4buiWqgHwTnqUqRrAH4Y/Q8RraBmg== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2019 09:26:35.8448 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87958538-9552-46d6-c64c-08d676148e04 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB4449 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 This patch adds a SHA3 DT node for Xilinx ZynqMP SoC. Signed-off-by: Kalyani Akula --- arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi index fa4fd77..a3be330 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi +++ b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi @@ -124,6 +124,10 @@ <1 10 0xf08>; }; + xlnx_keccak_384: sha384 { + compatible = "xlnx,zynqmp-keccak-384"; + }; + amba_apu: amba-apu@0 { compatible = "simple-bus"; #address-cells = <2>;