From patchwork Tue Nov 30 08:54:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harsha X-Patchwork-Id: 516998 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A31EC433EF for ; Tue, 30 Nov 2021 08:54:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239899AbhK3I6D (ORCPT ); Tue, 30 Nov 2021 03:58:03 -0500 Received: from mail-co1nam11on2086.outbound.protection.outlook.com ([40.107.220.86]:5857 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239881AbhK3I6C (ORCPT ); Tue, 30 Nov 2021 03:58:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dxjpKLKex9Da/qloYh4FHeNbMXduJUv1bPG2I28aN/XaxREWDBJ5Ml/3BeXxp/CERi4DtPgcIQ8U0zwrPfmA+Fr/RJmn0r36xWy4otoDt+oSowedjDRBbRmI/CPyuXz0PksYVNxMXFPTcGglljsVY2Hl6bvunTd1w6d5ulN1LkbdKJ19TT7m0q7MiCXC+tyPuYH/8Hhaxt5fxe088CkCCL0RsMEZNbWPch7r95A5qpCTgrZOnZmbVuhZ9sUcBALnYVn8PvZvB4ficjMat5qdOVpvESd7UIOLA6gtpym3pwVfJRdTkvVE9W6JUxrhtcEqhczQh9XTQmwgTCdat1Ly3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5FOa2arI1sddG8B5qhb+GRykzE+KyeniB8TwZdMqB4c=; b=mSF6P1LrUNznRxv2YaSJwtIJvCb97DEFqxlLr+/QBTBrzsPt3bKX5Ynb6xs9BtGfRtjER+pmOdCWQ90ueieythiIgJENya1h/s6H7RxXjFGcWj09ua3eU4Z8ac5qt1MDnxBpTBHlMmJRv54lBeRXCEU49xjObZzd560b8jBW3NqH4pCeOMqHGHQpyF17N6uxqEHgKxN2ZMJp1vPPBQVbOw4gUq0/RxEDINotOyqt3AgAOd0rjqxZ6ti1sPK7Ey47JAj9ROBX/vDqxBSKn65IWHm3qs82qMi4ftrJ9Lg3FBS24esnvRO6c50xGaxSwImNMhVbePpm/soG5vVDMJeZ6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=gondor.apana.org.au smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5FOa2arI1sddG8B5qhb+GRykzE+KyeniB8TwZdMqB4c=; b=A1+tHjYudyVO4W5Y3gRSHWuYJJyPLjheagg9R7B9b6FshR2wKyU3x4yY0K1hdUXjtXIWwaoMANqNvZZ/98cYA1nZIeScO0yRndgDJj9mS6JD9t9+DejrXPW+13wrAM2NOShPzcJ2Y5Mc9PoEqlda7u2lDJOCeeKhjFBC5I9yKWc= Received: from DM6PR02CA0068.namprd02.prod.outlook.com (2603:10b6:5:177::45) by BN0PR02MB7870.namprd02.prod.outlook.com (2603:10b6:408:149::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Tue, 30 Nov 2021 08:54:40 +0000 Received: from DM3NAM02FT017.eop-nam02.prod.protection.outlook.com (2603:10b6:5:177:cafe::74) by DM6PR02CA0068.outlook.office365.com (2603:10b6:5:177::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11 via Frontend Transport; Tue, 30 Nov 2021 08:54:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT017.mail.protection.outlook.com (10.13.5.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4734.20 via Frontend Transport; Tue, 30 Nov 2021 08:54:39 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 30 Nov 2021 00:54:34 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 30 Nov 2021 00:54:34 -0800 Envelope-to: herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, devicetree@vger.kernel.org Received: from [10.140.6.6] (port=56576 helo=xhdappanad40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mryuI-000GNC-Fu; Tue, 30 Nov 2021 00:54:34 -0800 From: Harsha To: , , , , , , , CC: , , Harsha Subject: [RFC PATCH 1/6] drivers: crypto: Updated Makefile for xilinx subdirectory Date: Tue, 30 Nov 2021 14:24:20 +0530 Message-ID: <1638262465-10790-2-git-send-email-harsha.harsha@xilinx.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1638262465-10790-1-git-send-email-harsha.harsha@xilinx.com> References: <1638262465-10790-1-git-send-email-harsha.harsha@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 10b1d3a8-af67-49e1-2759-08d9b3df0afa X-MS-TrafficTypeDiagnostic: BN0PR02MB7870: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TGsqXw5QI/pmS1hfdsCa/nco9DvXkEFneT43KgaENLM3kovB0PhErrga5GvXdYFcP3b9rVmKbeb7gaPWrfo9fbiLklq0uMxNFdcB6byLmQ7KTBZs6CRYuE8mMC3BRo7uoIAf5rEEdRXRWnA2yfzFXsQFEGecBTan8W/S1nv03BuANUgrtmiC5d2VZUfWzDueBC84CBNYXuKG8ewnrP4p3QyVmU5+5DptMlNQyChINaWfetthrk0tIdeeANsRC1D6hhQRlFYKLdh6IOfiebyqEk4okNfvO+1133SrpaqQAtPY+KSLWjBLa+qml8ODmMz96UVdDjWeYCIjSepGwgzB3ZAn1+4MR9gbQdWjZku4gSjoTrW1AMPDqsFwSPoP9dVSwzfg++gXpI6YizsfQLx7CWwApvebfPLNakeIiJcpreb75T/IBR1Q4aB5fCFcLNZqJYa8g7NhiV2VPbdQjn/FIRNYfF5sjs9zRGoWN5IYl4raFVfgJ3O97lwHiM0y+S/TCbMNRrzPpUIUYDdNGt6i0dYhuSqrb3z7J0eUbviAnn46Hdlx4f4KK/rTK2hu3xyxAtZiWBFVNRhOCl19HYNKKBrMScd8BqSNPRXD1pRyUEnW1FfSfvwkliP7SB/L0iO9JR8S17bKeWqBC389q1lH7Fp/C3G7F1Fkfutpk5EuwtHw5Y8m5aaVQiWjFEBjyLCgjpxFFmHSsv51ys3dwgVgyjvqT2sFo09SiqOCDcCqlyY= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(46966006)(36840700001)(9786002)(2906002)(70206006)(336012)(70586007)(356005)(316002)(426003)(47076005)(7636003)(83380400001)(15650500001)(2616005)(107886003)(110136005)(7696005)(508600001)(54906003)(8936002)(82310400004)(186003)(36860700001)(8676002)(6666004)(4744005)(36756003)(5660300002)(4326008)(26005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2021 08:54:39.1961 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10b1d3a8-af67-49e1-2759-08d9b3df0afa X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT017.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR02MB7870 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patch updates the Makefile for xilinx subdirectory. Currently the xilinx subdirectory includes only zynqmp-aes-gcm.c. Since this patch series adds zynqmp-sha.c in the xilinx subdirectory, so the Makefile needs to be updated. Signed-off-by: Harsha --- drivers/crypto/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile index 1fe5120..0a4fff2 100644 --- a/drivers/crypto/Makefile +++ b/drivers/crypto/Makefile @@ -47,7 +47,7 @@ obj-$(CONFIG_CRYPTO_DEV_VMX) += vmx/ obj-$(CONFIG_CRYPTO_DEV_BCM_SPU) += bcm/ obj-$(CONFIG_CRYPTO_DEV_SAFEXCEL) += inside-secure/ obj-$(CONFIG_CRYPTO_DEV_ARTPEC6) += axis/ -obj-$(CONFIG_CRYPTO_DEV_ZYNQMP_AES) += xilinx/ +obj-y += xilinx/ obj-y += hisilicon/ obj-$(CONFIG_CRYPTO_DEV_AMLOGIC_GXL) += amlogic/ obj-y += keembay/ From patchwork Tue Nov 30 08:54:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harsha X-Patchwork-Id: 519437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68D0AC433F5 for ; Tue, 30 Nov 2021 08:54:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239888AbhK3I6D (ORCPT ); Tue, 30 Nov 2021 03:58:03 -0500 Received: from mail-dm6nam11on2053.outbound.protection.outlook.com ([40.107.223.53]:30464 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239889AbhK3I6C (ORCPT ); Tue, 30 Nov 2021 03:58:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h4TCMRpdiCDYmdGZB4XNusRfwilbBBRbngc9BCVmuJw4uNU6a2PJ9Ov7kVvRQOWf8M3q6AH0K9JWSsv7zc8NvCjdFvn04WenqaA6GFPbZToNCJxNaZUstoMAkb9CWub7YMpHcAdYJF4Ms2Pk+ox3cSuYQ7pKFoVnYb+MbqsBkmJa4qrcSBZ89qxCy7Hu34AzsQj6Pxs8HfzlIgFe5t4THwHWn1aPiCm44+MKjZEs+QV1Kz1E31wijUjMQ+x6MzIbVuuQHvjzUKwFckSKJxcF8BODx00CtFPJejHJpdtY1R+bW8FhPLSO1mrnOl+gz9fEoZRJtTobOVEImnBanpaNVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o8KsoEK/E5flaUtXpeiB1VxfXCpdMm2TkAxCfqtb1SQ=; b=SgUa9AvGmgIhDozIln/XrPalwwbzHvzIQhiTOy0vKp2Wrb7MlgGiNGf+Zexf+Fay6L74IOhEjDlWeRmjsBy93GNnOQ7d06T/iD3+ag/l4+RB3AapE/UZ1mkyW5cgEld2zRYBXBuIEblsy+D6yQ2/67keesaUDH+Xhixn4HDopFC/ewK+z4IpG8lFb6B49k5dpD92u5XaJiYCVr2Sn5iR8rjdIYhi/cpIe7NnhkQ9nrpeFHxXtIzLdeqPlEz7TcimThFW7cKVLIrYkq6CTeuXXGkKDJzHMd8Uzhr9jA3azld/MAREn7tZVhCrYqgfbzZOU0fg0j11jshimhZu/Palaw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=gondor.apana.org.au smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o8KsoEK/E5flaUtXpeiB1VxfXCpdMm2TkAxCfqtb1SQ=; b=daDTv3PSkG2ojcwhnC1Lh7zxT+N3XZmkm2emSxtMe6AvjD7AzeYQXTqStnqprTbLtk1HXu6w82RQI+1vu66ULTq2Wou/wqeEugUlnpp4yhuct9COCHQIVuCmjFmA6yiWul6x9+7uDL7Vt2eUY6RivXfHDyjFi6o8t+W1GujfDHA= Received: from DM6PR02CA0060.namprd02.prod.outlook.com (2603:10b6:5:177::37) by BYAPR02MB3941.namprd02.prod.outlook.com (2603:10b6:a02:f8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Tue, 30 Nov 2021 08:54:41 +0000 Received: from DM3NAM02FT017.eop-nam02.prod.protection.outlook.com (2603:10b6:5:177:cafe::b7) by DM6PR02CA0060.outlook.office365.com (2603:10b6:5:177::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11 via Frontend Transport; Tue, 30 Nov 2021 08:54:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT017.mail.protection.outlook.com (10.13.5.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4734.20 via Frontend Transport; Tue, 30 Nov 2021 08:54:41 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 30 Nov 2021 00:54:38 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 30 Nov 2021 00:54:38 -0800 Envelope-to: herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, devicetree@vger.kernel.org Received: from [10.140.6.6] (port=56576 helo=xhdappanad40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mryuL-000GNC-Mu; Tue, 30 Nov 2021 00:54:38 -0800 From: Harsha To: , , , , , , , CC: , , Harsha Subject: [RFC PATCH 2/6] firmware: xilinx: Add ZynqMP SHA API for SHA3 functionality Date: Tue, 30 Nov 2021 14:24:21 +0530 Message-ID: <1638262465-10790-3-git-send-email-harsha.harsha@xilinx.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1638262465-10790-1-git-send-email-harsha.harsha@xilinx.com> References: <1638262465-10790-1-git-send-email-harsha.harsha@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3b1a2dd8-db45-481f-dc33-08d9b3df0c25 X-MS-TrafficTypeDiagnostic: BYAPR02MB3941: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FbiP75DugbDiSrTnoqzgQ6UAU5DKfQ4sp5pUHVlBUx95LGsHo/j5rKKry44YbQMkRbjs/Pj05VcCG2odaXvlyZAdxP8j4e60YieMWtlvEqUVMWK5QGvi68qr2b9yXgUxxZxKjHoOl0Ik3tQxEJwfXVdnCNzUihiJvMtOFNL4Un/mzAxKOvTyq2KIqZUCOtNWOW1LM4j2uu2rwLpF9MwsTK8jDJARtIB+G5nOC/jR2Oo4LkQWBybdbun8v1ohugpO0N5aITBuLONaQAr55yhUvHyMhrjiWrBAfjc/Izmuz02P56qr3LlsAIdRtwSsLoHEBUdeJQFnnq4gBz29yV3MkwRMyzA588kIK1oK0FW/6L7CYCuBbJawfXVfKDjF5pu4N4RGe6ablcN/jlnZ6SAbGrYeS9GaAwURAJqt3PhB9GAEe5L2aHgCUiBaCDDw3Uvlvx1mraBCFX1e5AKpwSgiEIXp9pWnQ6SsOi3O2Cm/OstDhx9akw8WueZ/YtDp1MNo8d5M8i/YHk3tRo9J0OrYHtv7NcdZ5PFpuQls+hpdcIl0R/0Iw8UNIxwZ3dV8P68Umu/hPbQYulSJzulAMa8+lfySFdtUNcZNFP3ERGwnBARa6wubnZ6XVsLHG39zBFUNHxlo47HHxvXnfGz692s4GuvhQJWNJFw+q00UjIQu+lMmnfnIzFc3A7A7FM4DzPX95bYgFFvd/avnrZLSZfbbK5Hkarla2ok3sosdHMVC65g= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(46966006)(36840700001)(82310400004)(186003)(54906003)(8936002)(110136005)(7696005)(508600001)(36756003)(5660300002)(4326008)(26005)(36860700001)(8676002)(6666004)(336012)(70206006)(47076005)(70586007)(356005)(316002)(426003)(9786002)(2906002)(7636003)(83380400001)(2616005)(107886003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2021 08:54:41.1612 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3b1a2dd8-db45-481f-dc33-08d9b3df0c25 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT017.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB3941 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patch adds zynqmp_pm_sha_hash API in the ZynqMP firmware to compute SHA3 hash of given data. Signed-off-by: Harsha --- drivers/firmware/xilinx/zynqmp.c | 26 ++++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 8 ++++++++ 2 files changed, 34 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 3dd45a7..a84c5ea 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -1117,6 +1117,32 @@ int zynqmp_pm_aes_engine(const u64 address, u32 *out) EXPORT_SYMBOL_GPL(zynqmp_pm_aes_engine); /** + * 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. + */ +int zynqmp_pm_sha_hash(const u64 address, const u32 size, const u32 flags) +{ + u32 lower_addr = lower_32_bits(address); + u32 upper_addr = upper_32_bits(address); + + return zynqmp_pm_invoke_fn(PM_SECURE_SHA, upper_addr, lower_addr, + size, flags, NULL); +} +EXPORT_SYMBOL_GPL(zynqmp_pm_sha_hash); + +/** * zynqmp_pm_system_shutdown - PM call to request a system shutdown or restart * @type: Shutdown or restart? 0 for shutdown, 1 for restart * @subtype: Specifies which system should be restarted or shut down diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 47fd4e5..38ef708 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -78,6 +78,7 @@ enum pm_api_id { PM_FPGA_LOAD = 22, PM_FPGA_GET_STATUS = 23, PM_GET_CHIPID = 24, + PM_SECURE_SHA = 26, PM_PINCTRL_REQUEST = 28, PM_PINCTRL_RELEASE = 29, PM_PINCTRL_GET_FUNCTION = 30, @@ -410,6 +411,7 @@ int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, const u32 qos, const enum zynqmp_pm_request_ack ack); int zynqmp_pm_aes_engine(const u64 address, u32 *out); +int zynqmp_pm_sha_hash(const u64 address, const u32 size, const u32 flags); int zynqmp_pm_fpga_load(const u64 address, const u32 size, const u32 flags); int zynqmp_pm_fpga_get_status(u32 *value); int zynqmp_pm_write_ggs(u32 index, u32 value); @@ -581,6 +583,12 @@ static inline int zynqmp_pm_aes_engine(const u64 address, u32 *out) return -ENODEV; } +static inline int zynqmp_pm_sha_hash(const u64 address, const u32 size, + const u32 flags) +{ + return -ENODEV; +} + static inline int zynqmp_pm_fpga_load(const u64 address, const u32 size, const u32 flags) { From patchwork Tue Nov 30 08:54:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harsha X-Patchwork-Id: 519436 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75A53C433FE for ; Tue, 30 Nov 2021 08:55:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239898AbhK3I62 (ORCPT ); Tue, 30 Nov 2021 03:58:28 -0500 Received: from mail-dm6nam12on2063.outbound.protection.outlook.com ([40.107.243.63]:57120 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239904AbhK3I6G (ORCPT ); Tue, 30 Nov 2021 03:58:06 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yo4Ux+b1EGLPMvM85DzB9SNHX09bgzg4fWYM+tvd21YNaTphCAspD86qRrBGAhNCyegTG4H4zsmuoJ9ilxOqcf+NqgV2fnYY6+APFalm70GpoVB4UovYqaTvbgZm8jBsGuETLbuWAJCo0q42mt/gT/UylbX4r3LG26T1JCIeelVwuMzAXZ72Py7ItGUR3nO2lcWF3AXLRiVa1OkaPQXn8O6sHYvhmm8vVpkmoqtv58EnNrSf19OzFP/6YxJ1p3kCheZ0kq0tB+XvLFvqiIO0luKP8FlZWnhF2k0be6zkQtpJLao9SWx7yhQQmtULSA7o/iIuWUfDzuAfC8JR1pSCLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ze6WcJmkN9wp8KSPFGSjWr94sSuCPpVcCkDngb5vXuQ=; b=Ic6Rt0OxE5ZXCOtgOr0Uuh3QrBKr6BQxWwK4d6+W6tWQY9e8p8AIubGeiewECkiZB3b4G5U8s5Woq6gKSb3AD2mFC3va6zju9Zq3ojU0rL+MtxzO0ly0XA/csKrQYTmH4/7Js6RuFrf8l1SKzfJkrVagiHHHDSNXZ3ks4z6Y6iUdyR6MvlzxKV74XvUoQPzkhQbWPnVBwMvcbEMoM1bt7ip7ycOg2hVSvePs9cXp8+k9IgUQYjiVi8vqkolnvGjaVtO85EJ+DMnMzxHgSvWRQmiqi7ecoo6txtCmA+NAh5rme0wB6I3HGRAvQMtXwWNM/tGIJvV8eRpcKw61jNlLgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=gondor.apana.org.au smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ze6WcJmkN9wp8KSPFGSjWr94sSuCPpVcCkDngb5vXuQ=; b=NcFRUOLFi/fgrOU3NeiGHPOj47n/vWCOuLubv/WNAGVEX2qCgfhWxOfuq+YHeVXtnd9XfFxmNG+FXTAoBWXhk56ZRad9sP3XpisatyuWWg120DZo1zM4URMsi4JmJ/uDp6Ib2ux6SZuPri52JrR1oj9SJJGBufrTo1IDMgQTjhQ= Received: from DM6PR02CA0055.namprd02.prod.outlook.com (2603:10b6:5:177::32) by PH0PR02MB7463.namprd02.prod.outlook.com (2603:10b6:510:15::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Tue, 30 Nov 2021 08:54:42 +0000 Received: from DM3NAM02FT017.eop-nam02.prod.protection.outlook.com (2603:10b6:5:177:cafe::e5) by DM6PR02CA0055.outlook.office365.com (2603:10b6:5:177::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23 via Frontend Transport; Tue, 30 Nov 2021 08:54:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT017.mail.protection.outlook.com (10.13.5.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4734.20 via Frontend Transport; Tue, 30 Nov 2021 08:54:42 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 30 Nov 2021 00:54:41 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 30 Nov 2021 00:54:41 -0800 Envelope-to: herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, devicetree@vger.kernel.org Received: from [10.140.6.6] (port=56576 helo=xhdappanad40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mryuO-000GNC-U5; Tue, 30 Nov 2021 00:54:41 -0800 From: Harsha To: , , , , , , , CC: , , Harsha Subject: [RFC PATCH 3/6] dt-bindings: crypto: Add bindings for ZynqMP SHA3 driver Date: Tue, 30 Nov 2021 14:24:22 +0530 Message-ID: <1638262465-10790-4-git-send-email-harsha.harsha@xilinx.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1638262465-10790-1-git-send-email-harsha.harsha@xilinx.com> References: <1638262465-10790-1-git-send-email-harsha.harsha@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7b047c5e-58c3-49fe-4012-08d9b3df0d26 X-MS-TrafficTypeDiagnostic: PH0PR02MB7463: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zKjm9LBpX/hkw64H/OijNE3uNR0Bnk9HQRyTEvuWTXQv6zO+tKP3XtzklN3KWKjZtJ2/BjTOFZENZP0B27Ag6q8s7guSPMFn8NUR0U2FJtXahMGfoHHGL5Vfnmov8WPsvirSEvNcNASINg82f1a4nXt+A95xrCJtauHDTIcMsTjOenD9SvWOB5Nc/sqdu/fPlA9j6SgFLJVcw7TynXpQNsWNjhvg1iwZ4oWpfOggGA1SeSi9Oe9SHQeqgBWal1kV+Py6UlK5XCOOvKQGF9LKx9WqbRJjsHofIT4M3UGeH0KrsJLAwz8+N7KaEtfgmYL0Xa/DSvdJpfYFT02H9kUEw+nUBDycpQQUnqxR+JWAJweg9KLkktLSivF6AdpO6MSYRz1X8+GnSeZJlS6+WuUDw2oxQlyTeXJhs0vgZoDYH6VjZJwpIfW9u4BHmErMvRKzi7Hw6LdB5BLoZ+DZ5Efqsw8yPDqKp91CZYUHACBjp0sOqhBRvb8IFZaMLIG0oLyiWJKK9j3Ywz/7QBa54xRkC+DHt3F0/qo6AaEQzyfxG9P7ei8FUu9P35qdFZAS/6Gr2byzk9VXXLxJeCOQlb49bopNnlSaPIoo1CLf75B7F+kSb951ccdZsWmQVL5vzuAXfczsPvIE/GpcAO62+8vrNHqyXq4XC9lKwmoF7UwQT2YL4LiyCov2+69Lnfiof8LZ2wD3WT0RRXJR3fMQU2QTh5YRsdWAD0/HloujKbzkYTrmJ64OycjvwGxEiJeyQW4ov1G34GmGDIY4rAz63si8WS5y+Xx0BqgeiF49E3sZPTVMLdQeGYyL5VMJGoW95XotfPfg5T2NX+WJ20PR06Uspfmoum/FH8yTm/uNu89oMNA= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(46966006)(36840700001)(7696005)(508600001)(426003)(186003)(26005)(336012)(47076005)(8936002)(9786002)(6666004)(36756003)(2616005)(7636003)(2906002)(5660300002)(107886003)(8676002)(316002)(966005)(36860700001)(356005)(110136005)(54906003)(4326008)(82310400004)(70206006)(70586007)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2021 08:54:42.8415 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b047c5e-58c3-49fe-4012-08d9b3df0d26 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT017.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR02MB7463 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patch adds documentation to describe Xilinx ZynqMP SHA3 driver bindings. Signed-off-by: Harsha --- .../bindings/crypto/xlnx,zynqmp-sha3.yaml | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Documentation/devicetree/bindings/crypto/xlnx,zynqmp-sha3.yaml diff --git a/Documentation/devicetree/bindings/crypto/xlnx,zynqmp-sha3.yaml b/Documentation/devicetree/bindings/crypto/xlnx,zynqmp-sha3.yaml new file mode 100644 index 0000000..45a8022 --- /dev/null +++ b/Documentation/devicetree/bindings/crypto/xlnx,zynqmp-sha3.yaml @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/crypto/xlnx,zynqmp-sha3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Xilinx ZynqMP SHA3 Hardware Accelerator Device Tree Bindings + +maintainers: + - Harsha Harsha + +description: | + The ZynqMP SHA3 hardened cryptographic accelerator is used to + calculate the SHA3 hash for the given user data. + +properties: + compatible: + const: xlnx,zynqmp-sha3-384 + +required: + - compatible + +additionalProperties: false + +examples: + - | + xlnx_sha3_384: sha3-384 { + compatible = "xlnx,zynqmp-sha3-384"; + }; +... From patchwork Tue Nov 30 08:54:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harsha X-Patchwork-Id: 516997 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D057FC4332F for ; Tue, 30 Nov 2021 08:55:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239921AbhK3I61 (ORCPT ); Tue, 30 Nov 2021 03:58:27 -0500 Received: from mail-dm6nam10on2061.outbound.protection.outlook.com ([40.107.93.61]:34305 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239922AbhK3I6G (ORCPT ); Tue, 30 Nov 2021 03:58:06 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZvqfWPtAC1w4faghGJk9+HNX/PLqieU1FfWJRF2TOoKHz6GJDW/VQ4qoEQcGoS/kuXoKdUc77iEMuXX/gkGoIa0DoupZ66as5P+RcVrDA5yNsvdsf9uJCNwcTUXqvkitsxkMA9EqOES70XOxzlaKFcHvdntCcdxywykgeS2+kWy89vHU8f7/T5t2TzNtvAYOL8ddy97AFohoHXuzdOuGqqJNpuiOCu6hmAamcjZfRuKdfcZALdLmLefKQkTSsw2nk+t0FGMrz5WRksGNzmd/wYXY0c32+hwBV1q1Dcjw84Sa84g/F+j0ked+y6r1vU6838BS2YohqJfv6Q7hufAXbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yn1idgsrINtwXzIfFMcoi8JlSDgxZYo+E3PlYIHq85Q=; b=lTK1Baac9FVBODLgoRkpnrvlstOujJsQ53RPm9fRCfG9OdZMge46V/2wAXYbpJbp/GMWpS1Bp4V8M33Q5YixObtcfDgI2lt7qULV6XDMGCzOKGpQFQsKgdMIHNuZ3NSMgpquTE5Cr1pgWuIVzQYELJJmJ14oldhfRh1Vm9NdDTppmA+d4skPRnC0rBnDTIK+5pDeh5YVnskm/tI9ilKJtIXxegyNXRe7tIQ4Pgl6OjosmW4qs8oiSCBDyoU+SptB2DdlrwOLgjueUNNP5Y+71HxSdhyxztxMaDUnA5CrDO/vbIWlI/lFqIU5UVi2v1bz3n39MoUYrJ6m07Phd05zjA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=gondor.apana.org.au smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yn1idgsrINtwXzIfFMcoi8JlSDgxZYo+E3PlYIHq85Q=; b=PZflkUVEToYmLgQr0lgPEqGOeov0yGGloXw3hAU5RAx0+gY1wkr71SZcyAVXtljRUVKuT0IriUxTWBOc6reu6nBg8Zw7evwwBIInnQuPqTHa4eZHVElZReJzf+rGgb+ioy7o9Py0/1iwNqchZxD9G8/OjLQpQrFeqEz0LWEOvA0= Received: from SA0PR11CA0065.namprd11.prod.outlook.com (2603:10b6:806:d2::10) by SN6PR02MB5295.namprd02.prod.outlook.com (2603:10b6:805:67::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Tue, 30 Nov 2021 08:54:45 +0000 Received: from SN1NAM02FT0064.eop-nam02.prod.protection.outlook.com (2603:10b6:806:d2:cafe::6a) by SA0PR11CA0065.outlook.office365.com (2603:10b6:806:d2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23 via Frontend Transport; Tue, 30 Nov 2021 08:54:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0064.mail.protection.outlook.com (10.97.4.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4734.20 via Frontend Transport; Tue, 30 Nov 2021 08:54:45 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 30 Nov 2021 00:54:44 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 30 Nov 2021 00:54:44 -0800 Envelope-to: herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, devicetree@vger.kernel.org Received: from [10.140.6.6] (port=56576 helo=xhdappanad40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mryuS-000GNC-5S; Tue, 30 Nov 2021 00:54:44 -0800 From: Harsha To: , , , , , , , CC: , , Harsha Subject: [RFC PATCH 4/6] arm64: dts: zynqmp: Add Xilinx SHA3 node Date: Tue, 30 Nov 2021 14:24:23 +0530 Message-ID: <1638262465-10790-5-git-send-email-harsha.harsha@xilinx.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1638262465-10790-1-git-send-email-harsha.harsha@xilinx.com> References: <1638262465-10790-1-git-send-email-harsha.harsha@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 10348434-ea36-4b08-6198-08d9b3df0e81 X-MS-TrafficTypeDiagnostic: SN6PR02MB5295: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:1079; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gdyNbKW5LfiGQ38VsBbOu8zzbjTx1jNG1yXgbBvCrfxSItI+0l6MFhYbVqWzY35PsMasNh8UrvUznI1Dp8088BlfqyOsImX9votFhNnqh3JlRkhKsDJvkVAkCrXPdxM+FxbQ6YpCnPitG2A+kSVyqtFjqTV1ywDR9b1PlMO049U9jAf9GlvNzCKxkuHrtRPJkLTYtPUbv1QSeYcdZsq+M1c6uCYoOlrMmJLtiY3uXpKCh9C40QpCFidwIqH8tbLAmyarrUcz/iu4JI3/GqXHQzARlMoOr/28SEkBWeQOu8ibVqYmVzJm0gPDhgYepAFHMRXV5C6G911QTohLTJcFJRincX0GvJ/wl7lj80Rrg9ofV54BMhXueIxSoman4dVCT3xDCCTYuzPEIgUwvTbPuvCEO2Ao328xDGfMxPN4JK1kFegfk/lLxKq/6apo4AX96PrxOXHuJxES06Ubjl7EodKtKbcKRrM1l2Ug0V7ElEoTLf0eSstbtjnRSZnS4A3fV1gVrQH5XP1kw3z0RBZZsPQWD1MiCOM/4yQQ/lgf4J36+oGm7IfFHySHllRXY/YYKvO3e//1u/CD0jt2T5jGdLQT30/VRI3MZPfC0yq9i+ww8d9x23/1uMexP0lKop1P5TBJB8Ddb78hg6vzR00nC9i6rAar3EPLBrDdH7otr9QaQRcD1tbYgcugCwEiRp0l6b5z0btRJbI2VwVI0hGxEpTWL1N03dcY9kfiCN4QssQ= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(46966006)(36840700001)(426003)(82310400004)(508600001)(186003)(4744005)(70206006)(6666004)(107886003)(2616005)(336012)(26005)(36860700001)(70586007)(7696005)(54906003)(4326008)(316002)(2906002)(36756003)(8936002)(5660300002)(7636003)(9786002)(110136005)(47076005)(356005)(8676002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2021 08:54:45.1265 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10348434-ea36-4b08-6198-08d9b3df0e81 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0064.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB5295 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patch adds a SHA3 DT node for Xilinx ZynqMP SoC. Signed-off-by: Harsha --- arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi index 74e6644..33b7ef6 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi +++ b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi @@ -174,6 +174,10 @@ compatible = "xlnx,zynqmp-aes"; }; + xlnx_sha3_384: sha384 { + compatible = "xlnx,zynqmp-sha3-384"; + }; + zynqmp_reset: reset-controller { compatible = "xlnx,zynqmp-reset"; #reset-cells = <1>; From patchwork Tue Nov 30 08:54:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harsha X-Patchwork-Id: 516996 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DADEC4332F for ; Tue, 30 Nov 2021 08:55:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239962AbhK3I6l (ORCPT ); Tue, 30 Nov 2021 03:58:41 -0500 Received: from mail-bn8nam12on2072.outbound.protection.outlook.com ([40.107.237.72]:28896 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239893AbhK3I6L (ORCPT ); Tue, 30 Nov 2021 03:58:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BlPZcRJmfo7bYu+BiKgbqrhYIli/RazrUuJL+Nnk0XPcJ8wHmvvXgtOu6qoele/H3ldqbM/M9EtgD7X5EwFOvvSGNLcH9sMQJuGKvMAwPsdwvbDsHkxvBH0Pmy7TSh18FS5y+jMijLJfaO7hpEbSOzVQPHQKZAe1Tt6CD4F4YwzPkvp7U1D6maLCnLuwTinXAq6ltiQEm/w/VqjbH+qx6/CBynoe1ct1t8VubT8mjw1KhgOOZA3jB3izwQGqLFbEpnFxTXmUJKKlZfGAw/5wkurvTDOG9+khLzqYDBUsP+CBBvATPQ//3doCdRt9H4c7h10yWkaC0O+xFEv94syuUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yyGmwTr7UZIrxPwylXddOHr+vzjMI8ySftfu1NFGbwY=; b=ejoQhES+BSVgyHui8HSih5Fkhk+ru/n6MIbDNy98OxB5oKNbmlt7GzTWjelT69N6K4fADy0073KuKO3oVhqnA9OnUPte1/iAbOhzEtNPjypK31ubpF6LSievpdLpA0vFlJSGNVZSzcEaWOQgtaVvGh4JCCMcd6Phm+4Fhqc7hSYNSc5epzKu8azzJDn6UCXV5L3/YxLe/5AipSjH0j2S6fMIxs9UO5Q+V5I3Zl8pn+1vNWoaqFZ7Gp8UCqQX7r6CO6Z7GZ7RxII7bALa10G88PdMzgWmoKkLaJ9YY37RfrrM6Lr+TXl+8FaJ/YGQ7l7NN2DbVdDgJFdplEFH8AKjRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=gondor.apana.org.au smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yyGmwTr7UZIrxPwylXddOHr+vzjMI8ySftfu1NFGbwY=; b=fiuqjyJzW1RYHT0EcbtX1DxXaCskpwXM9v2Z776yEDy6WXBOXq91vxpu7rRuCTOuWvhBd/0CJ2LUGlVORVX3kd3bk026RrPxcPXVNY8IzMxXVqBAE8eTlTjqixoK2SAFtaMNmsc8W4jbqzJFavdOQLprrnzuWIzwEuJgRLBhua8= Received: from DM6PR08CA0007.namprd08.prod.outlook.com (2603:10b6:5:80::20) by CO6PR02MB8772.namprd02.prod.outlook.com (2603:10b6:303:143::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.22; Tue, 30 Nov 2021 08:54:49 +0000 Received: from DM3NAM02FT014.eop-nam02.prod.protection.outlook.com (2603:10b6:5:80:cafe::50) by DM6PR08CA0007.outlook.office365.com (2603:10b6:5:80::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23 via Frontend Transport; Tue, 30 Nov 2021 08:54:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT014.mail.protection.outlook.com (10.13.5.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4734.20 via Frontend Transport; Tue, 30 Nov 2021 08:54:49 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 30 Nov 2021 00:54:47 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 30 Nov 2021 00:54:47 -0800 Envelope-to: herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, devicetree@vger.kernel.org Received: from [10.140.6.6] (port=56576 helo=xhdappanad40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mryuV-000GNC-CC; Tue, 30 Nov 2021 00:54:47 -0800 From: Harsha To: , , , , , , , CC: , , Harsha Subject: [RFC PATCH 5/6] crypto: xilinx: Add Xilinx SHA3 driver Date: Tue, 30 Nov 2021 14:24:24 +0530 Message-ID: <1638262465-10790-6-git-send-email-harsha.harsha@xilinx.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1638262465-10790-1-git-send-email-harsha.harsha@xilinx.com> References: <1638262465-10790-1-git-send-email-harsha.harsha@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 21bf53f7-2746-493c-9560-08d9b3df10d5 X-MS-TrafficTypeDiagnostic: CO6PR02MB8772: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HlubfANbvPdncnx27vgTd1wwq9C7EN1sYUe2EXQpXN+PDrVw+dY4bzH/JDa0rovyfwA43w9vOs0QlWILOovhS7xCoG2OfBF3lwFooqMz6X2IegYBHpK/8Ery/JV3ETexSL6lKGIGp5Ez/qeVmsRot80hqh3WeDZ3CITYz37ntmPFwWeWLOgE6z6kxg8pZZEYJzYM/kx3Mu5NnmSdU983XI7rkJuAF+6auBAwA+tLa8/fRRN39mKof/uahd0IwLhDKjxCwQWDFrcjYxlio7Uot5tCKzwK1KMrGc+duZQIm+DURSjMK0QDSdg9gME7tulgWn67mxcdglsoqjkATPMg8L99UTHnU65IZVFFIdgrK+8tR7dd4xSQic+RKwEjB5t/QOqMCxdxtK2eBv0ZZzGw9NpaeQb+E3OdQ909lQx8ZsTMyACEayjhGtQAD7Auvei9cHmW6yZQT4576JFfHFGNzZCtLGFYaLtrJGJbBbMXApd0S28U9XCBRuTNv2rvWka7NPYLt/KDmiCDj141uOyrhxrs+cu8tJdnfrbNSRFg9f8LPYCHIpNsXcS5aXJ6cCmQ8R8H2/qBMaCwcy4U33hTwUugmcjR9KzTe0DzAjSPHxDDn002U4d4l8K2XBbW2qpeOhJ7PsZf1ckXGwkPiw+U3AVM3nar8OZtXOgqR/SsipXNlRQjdvd3CaeV+h0rOn/19PPMfkJbiJo+Y6Fj1NrbZXGOY6dTQX5T/Khu4E2ULME= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(36840700001)(46966006)(8676002)(7636003)(8936002)(6666004)(82310400004)(316002)(26005)(356005)(4326008)(7696005)(36756003)(47076005)(110136005)(2616005)(508600001)(70206006)(70586007)(107886003)(36860700001)(2906002)(9786002)(426003)(186003)(83380400001)(5660300002)(54906003)(336012)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2021 08:54:49.0238 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 21bf53f7-2746-493c-9560-08d9b3df10d5 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT014.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR02MB8772 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patch adds SHA3 driver support for the Xilinx ZynqMP SoC. Xilinx ZynqMP SoC has SHA3 engine used for secure hash calculation. The flow is SHA3 request from Userspace -> SHA3 driver-> ZynqMp driver-> Firmware -> SHA3 HW Engine SHA3 HW engine in Xilinx ZynqMP SoC, does not support parallel processing of 2 hash requests. Therefore, software fallback is being used for init, update, final, export and import in the ZynqMP SHA driver For digest, the calculation of SHA3 hash is done by the hardened SHA3 accelerator in Xilinx ZynqMP SoC. Signed-off-by: Harsha --- drivers/crypto/Kconfig | 10 ++ drivers/crypto/xilinx/Makefile | 1 + drivers/crypto/xilinx/zynqmp-sha.c | 265 +++++++++++++++++++++++++++++++++++++ 3 files changed, 276 insertions(+) create mode 100644 drivers/crypto/xilinx/zynqmp-sha.c diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 51690e7..5df252e 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -796,6 +796,16 @@ config CRYPTO_DEV_ZYNQMP_AES accelerator. Select this if you want to use the ZynqMP module for AES algorithms. +config CRYPTO_DEV_ZYNQMP_SHA3 + bool "Support for Xilinx ZynqMP SHA3 hw accelerator" + depends on ARCH_ZYNQMP || COMPILE_TEST + select CRYPTO_SHA3 + 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. + source "drivers/crypto/chelsio/Kconfig" source "drivers/crypto/virtio/Kconfig" diff --git a/drivers/crypto/xilinx/Makefile b/drivers/crypto/xilinx/Makefile index 534e32d..730feff 100644 --- a/drivers/crypto/xilinx/Makefile +++ b/drivers/crypto/xilinx/Makefile @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_CRYPTO_DEV_ZYNQMP_AES) += zynqmp-aes-gcm.o +obj-$(CONFIG_CRYPTO_DEV_ZYNQMP_SHA3) += zynqmp-sha.o diff --git a/drivers/crypto/xilinx/zynqmp-sha.c b/drivers/crypto/xilinx/zynqmp-sha.c new file mode 100644 index 0000000..c7166ef --- /dev/null +++ b/drivers/crypto/xilinx/zynqmp-sha.c @@ -0,0 +1,265 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Xilinx ZynqMP SHA Driver. + * Copyright (c) 2021 Xilinx Inc. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ZYNQMP_DMA_BIT_MASK 32U +#define ZYNQMP_DMA_ALLOC_FIXED_SIZE 0x1000U + +enum zynqmp_sha_op { + ZYNQMP_SHA3_INIT = 1, + ZYNQMP_SHA3_UPDATE = 2, + ZYNQMP_SHA3_FINAL = 4, +}; + +struct zynqmp_sha_drv_ctx { + struct shash_alg sha3_384; + struct device *dev; +}; + +struct zynqmp_sha_tfm_ctx { + struct device *dev; + struct crypto_shash *fbk_tfm; +}; + +struct zynqmp_sha_desc_ctx { + struct shash_desc fbk_req; +}; + +static dma_addr_t update_dma_addr, final_dma_addr; +static char *ubuf, *fbuf; + +static int zynqmp_sha_init_tfm(struct crypto_shash *hash) +{ + const char *fallback_driver_name = crypto_shash_alg_name(hash); + struct zynqmp_sha_tfm_ctx *tfm_ctx = crypto_shash_ctx(hash); + struct shash_alg *alg = crypto_shash_alg(hash); + struct crypto_shash *fallback_tfm; + struct zynqmp_sha_drv_ctx *drv_ctx; + + drv_ctx = container_of(alg, struct zynqmp_sha_drv_ctx, sha3_384); + tfm_ctx->dev = drv_ctx->dev; + + /* Allocate a fallback and abort if it failed. */ + fallback_tfm = crypto_alloc_shash(fallback_driver_name, 0, + CRYPTO_ALG_NEED_FALLBACK); + if (IS_ERR(fallback_tfm)) + return PTR_ERR(fallback_tfm); + + tfm_ctx->fbk_tfm = fallback_tfm; + hash->descsize += crypto_shash_descsize(tfm_ctx->fbk_tfm); + + return 0; +} + +static void zynqmp_sha_exit_tfm(struct crypto_shash *hash) +{ + struct zynqmp_sha_tfm_ctx *tfm_ctx = crypto_shash_ctx(hash); + + if (tfm_ctx->fbk_tfm) { + crypto_free_shash(tfm_ctx->fbk_tfm); + tfm_ctx->fbk_tfm = NULL; + } + + memzero_explicit(tfm_ctx, sizeof(struct zynqmp_sha_tfm_ctx)); +} + +static int zynqmp_sha_init(struct shash_desc *desc) +{ + struct zynqmp_sha_desc_ctx *dctx = shash_desc_ctx(desc); + struct zynqmp_sha_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); + + dctx->fbk_req.tfm = tctx->fbk_tfm; + return crypto_shash_init(&dctx->fbk_req); +} + +static int zynqmp_sha_update(struct shash_desc *desc, const u8 *data, unsigned int length) +{ + struct zynqmp_sha_desc_ctx *dctx = shash_desc_ctx(desc); + + return crypto_shash_update(&dctx->fbk_req, data, length); +} + +static int zynqmp_sha_final(struct shash_desc *desc, u8 *out) +{ + struct zynqmp_sha_desc_ctx *dctx = shash_desc_ctx(desc); + + return crypto_shash_final(&dctx->fbk_req, out); +} + +static int zynqmp_sha_finup(struct shash_desc *desc, const u8 *data, unsigned int length, u8 *out) +{ + struct zynqmp_sha_desc_ctx *dctx = shash_desc_ctx(desc); + + return crypto_shash_finup(&dctx->fbk_req, data, length, out); +} + +static int zynqmp_sha_import(struct shash_desc *desc, const void *in) +{ + struct zynqmp_sha_desc_ctx *dctx = shash_desc_ctx(desc); + struct zynqmp_sha_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); + + dctx->fbk_req.tfm = tctx->fbk_tfm; + return crypto_shash_import(&dctx->fbk_req, in); +} + +static int zynqmp_sha_export(struct shash_desc *desc, void *out) +{ + struct zynqmp_sha_desc_ctx *dctx = shash_desc_ctx(desc); + + return crypto_shash_export(&dctx->fbk_req, out); +} + +static int zynqmp_sha_digest(struct shash_desc *desc, const u8 *data, unsigned int len, u8 *out) +{ + int remaining_len = len; + int update_size; + int ret; + + ret = zynqmp_pm_sha_hash(0, 0, ZYNQMP_SHA3_INIT); + if (ret) + return ret; + + while (remaining_len != 0) { + memset(ubuf, 0, ZYNQMP_DMA_ALLOC_FIXED_SIZE); + if (remaining_len >= ZYNQMP_DMA_ALLOC_FIXED_SIZE) { + update_size = ZYNQMP_DMA_ALLOC_FIXED_SIZE; + remaining_len -= ZYNQMP_DMA_ALLOC_FIXED_SIZE; + } else { + update_size = remaining_len; + remaining_len = 0; + } + memcpy(ubuf, data, update_size); + flush_icache_user_range((unsigned long)ubuf, (unsigned long)ubuf + update_size); + ret = zynqmp_pm_sha_hash(update_dma_addr, update_size, ZYNQMP_SHA3_UPDATE); + if (ret) + return ret; + + data += update_size; + } + + ret = zynqmp_pm_sha_hash(final_dma_addr, SHA3_384_DIGEST_SIZE, ZYNQMP_SHA3_FINAL); + memcpy(out, fbuf, SHA3_384_DIGEST_SIZE); + memset(fbuf, 0, SHA3_384_DIGEST_SIZE); + + return ret; +} + +static struct zynqmp_sha_drv_ctx sha3_drv_ctx = { + .sha3_384 = { + .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, + .init_tfm = zynqmp_sha_init_tfm, + .exit_tfm = zynqmp_sha_exit_tfm, + .descsize = sizeof(struct zynqmp_sha_desc_ctx), + .statesize = sizeof(struct sha3_state), + .digestsize = SHA3_384_DIGEST_SIZE, + .base = { + .cra_name = "sha3-384", + .cra_driver_name = "zynqmp-sha3-384", + .cra_priority = 300, + .cra_flags = CRYPTO_ALG_KERN_DRIVER_ONLY | + CRYPTO_ALG_ALLOCATES_MEMORY | + CRYPTO_ALG_NEED_FALLBACK, + .cra_blocksize = SHA3_384_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct zynqmp_sha_tfm_ctx), + .cra_alignmask = 3, + .cra_module = THIS_MODULE, + } + } +}; + +static int zynqmp_sha_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + int err; + + err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(ZYNQMP_DMA_BIT_MASK)); + if (err < 0) { + dev_err(dev, "No usable DMA configuration\n"); + return err; + } + + err = crypto_register_shash(&sha3_drv_ctx.sha3_384); + if (err < 0) { + dev_err(dev, "Failed to register shash alg.\n"); + return err; + } + + sha3_drv_ctx.dev = dev; + platform_set_drvdata(pdev, &sha3_drv_ctx); + + ubuf = dma_alloc_coherent(dev, ZYNQMP_DMA_ALLOC_FIXED_SIZE, &update_dma_addr, GFP_KERNEL); + if (!ubuf) { + err = -ENOMEM; + goto err_shash; + } + + fbuf = dma_alloc_coherent(dev, SHA3_384_DIGEST_SIZE, &final_dma_addr, GFP_KERNEL); + if (!fbuf) { + err = -ENOMEM; + goto err_mem; + } + + return 0; + +err_mem: + dma_free_coherent(sha3_drv_ctx.dev, ZYNQMP_DMA_ALLOC_FIXED_SIZE, ubuf, update_dma_addr); + +err_shash: + crypto_unregister_shash(&sha3_drv_ctx.sha3_384); + + return err; +} + +static int zynqmp_sha_remove(struct platform_device *pdev) +{ + sha3_drv_ctx.dev = platform_get_drvdata(pdev); + + dma_free_coherent(sha3_drv_ctx.dev, ZYNQMP_DMA_ALLOC_FIXED_SIZE, ubuf, update_dma_addr); + dma_free_coherent(sha3_drv_ctx.dev, SHA3_384_DIGEST_SIZE, fbuf, final_dma_addr); + crypto_unregister_shash(&sha3_drv_ctx.sha3_384); + + return 0; +} + +static const struct of_device_id zynqmp_sha_dt_ids[] = { + { .compatible = "xlnx,zynqmp-sha3-384" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, zynqmp_sha_dt_ids); + +static struct platform_driver zynqmp_sha_driver = { + .probe = zynqmp_sha_probe, + .remove = zynqmp_sha_remove, + .driver = { + .name = "zynqmp-sha3-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 v2"); +MODULE_AUTHOR("Harsha "); From patchwork Tue Nov 30 08:54:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harsha X-Patchwork-Id: 519435 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4C46C433F5 for ; Tue, 30 Nov 2021 08:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239912AbhK3I6k (ORCPT ); Tue, 30 Nov 2021 03:58:40 -0500 Received: from mail-co1nam11on2083.outbound.protection.outlook.com ([40.107.220.83]:22753 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239938AbhK3I6N (ORCPT ); Tue, 30 Nov 2021 03:58:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NA0xc1Bl7GJCdT7vGJok5d/OI5TcWOhGhtqclUH1JkUTPFoXIwKnCBEh9zDC1m2MUfUmfJFQ63ca9c8dB+chUgKn3qyN/5YDYnQDNCJc1hCUF7vZ29TDUHqWo6YUcM6xjMOqZWngt7zdBZQyS1BiC1ZIJlBRghvuT2j4ToZbzcn5DfN66DDJtXzfddUL8fnRLox14AwQdtPxeB5MNs4ZrQ0dwwSwlns9Uu8SFSumCT9j7VrTfD0dqWz1Ym6TmKdvFR/hdLW9Ja9lafKAMTa9Zf980T1RNSJgSh5peZtJa03eswSIMvJP41ZqcOd3tmf8P78Es4AMfqU1CD3Yl5tnEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Zchr9qtFTVfWWBTMlnpMtU22iPnAg2wqGzsXMDM+23s=; b=FUscyfAYiSDTD0Uts1O+CyDTDTQStDivHsxFJpYq25Klf/I+pHUEbp05UM+lo3rBjq5sTfeIWgF2LRau2XfddNzdEUx9cJPiMH+l60gQOF0m7WuKfVGmjyR+yIDlndmeVxyE9so5qSSPzge0CL0Jig1Ski2ySjveipJay1E5NoLdbPA5tehg58uRNBBJqPP5IP4uNyOIvh0Oh5Irr9G6wirMRKyOHVo3oLPfkvQKvwnel37jSWMxXnt2sQdh67MDehasdvFvVNqGdBSURYU8VKx9VcbHDU6atpZHY1Xl4tTdHwhLzy/2/TT2DO/HfWjVyxholKw2KAJBM5Dkbq8TMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=gondor.apana.org.au smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zchr9qtFTVfWWBTMlnpMtU22iPnAg2wqGzsXMDM+23s=; b=ICiPkDDKOHrhlFzon/4NKnIW86p6pDQaoBnGUbl7CEDsmjjt8WohRs/VWpHULZ1kX/U4Ild7cOGOR/w7+HDUGWRpQ1NZ3nDEvj8S4bipNCemDvrBh8V3y8deibFhs06ihEC/WKrAKHZERjJG+TdLfcosvN3OmohE26crigfuIng= Received: from DM6PR10CA0034.namprd10.prod.outlook.com (2603:10b6:5:60::47) by CH2PR02MB7064.namprd02.prod.outlook.com (2603:10b6:610:85::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.21; Tue, 30 Nov 2021 08:54:52 +0000 Received: from DM3NAM02FT064.eop-nam02.prod.protection.outlook.com (2603:10b6:5:60:cafe::5a) by DM6PR10CA0034.outlook.office365.com (2603:10b6:5:60::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.22 via Frontend Transport; Tue, 30 Nov 2021 08:54:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT064.mail.protection.outlook.com (10.13.4.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4734.20 via Frontend Transport; Tue, 30 Nov 2021 08:54:51 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 30 Nov 2021 00:54:51 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 30 Nov 2021 00:54:51 -0800 Envelope-to: herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, devicetree@vger.kernel.org Received: from [10.140.6.6] (port=56576 helo=xhdappanad40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mryuY-000GNC-Jw; Tue, 30 Nov 2021 00:54:51 -0800 From: Harsha To: , , , , , , , CC: , , Harsha Subject: [RFC PATCH 6/6] MAINTAINERS: Add maintainer for Xilinx ZynqMP SHA3 driver Date: Tue, 30 Nov 2021 14:24:25 +0530 Message-ID: <1638262465-10790-7-git-send-email-harsha.harsha@xilinx.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1638262465-10790-1-git-send-email-harsha.harsha@xilinx.com> References: <1638262465-10790-1-git-send-email-harsha.harsha@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eac4a872-eace-4655-b278-08d9b3df125e X-MS-TrafficTypeDiagnostic: CH2PR02MB7064: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:2657; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q+mJE34W3AD5z7sjM1cOBtwQtfdB7XmN3OfHf3TzZ0nBRZ32fYMXXDzQ1jCmHxmzme7b7guQRZhV+iOsllsEBJDUY0OOjarZNRDWvZA8Vr46N6QIT/nu7EPX81Y4U2vREOOmVRrs9xKEzpr228IYbGIEqCIynm4+BlhtBi80VIL4KUwdWKX3CQD2b2h18MaVBORcN+va9zU7xjd+Z5jyCq+y2FBWPmKapq1OHuXXh406Czo0+L/gorDAUp2ZW06I/UcjjRoltlBLywoad8Cl2wkvlHJHWKC+QqZPk3opjaXaGP42164lop/oMpiDqcItThNIuEqsHMdcwywAb7fpsIze4iK0J6tRomfKEEqEjlXV2Wrs9VvPEbKs4eBRsn72lxFtHPe/x47wDU3J92dFd2//4fSkq21hZsYIAMHbVtJlENwycb28TUZnDPpPSM1TAwpfgUKYUJv8eNsAAKSUDnDj7TN1BgMzIV25kma2t02ePslC0ZU09VsNfOwFBbUPUhGBQDzRKFH4gmcqOHBonuaSKui7zTAFfSne6wAlssMTYInqxhoXG3xnR+qyFpgVMazMGKVDIJ60K/DxJ1aa4MiKyX8fv1Xl6fcNatvLet71S+r+Q1YsI4G250nN02RP3/4sQtWPsPbFEOBGCCx+eaGog+C3ypo4cCnZP+YESYRWWP6Ew7+2h1mcv5gwyOJ/+ZR62cBmoj+0/mdAld08lD3xFoEZ4nYAqHKoDEK+4h1dpSNfypw6d507N0SG3UVFsG9Vm/l6WmFNWY1Hq5FumgU4XYEA8vOiPMuI9UgECs4Mtg6mTpLfTH+8GudCAJau X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(46966006)(36840700001)(426003)(2906002)(8936002)(82310400004)(70206006)(36756003)(4326008)(107886003)(316002)(110136005)(54906003)(70586007)(356005)(6666004)(47076005)(2616005)(7636003)(966005)(9786002)(186003)(508600001)(4744005)(26005)(7696005)(336012)(8676002)(36860700001)(5660300002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2021 08:54:51.6001 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eac4a872-eace-4655-b278-08d9b3df125e X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT064.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB7064 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patch adds an entry for ZynqMP SHA3 driver in the list of Maintainers. Signed-off-by: Harsha --- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0047564..73cc994 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20929,6 +20929,12 @@ T: git https://github.com/Xilinx/linux-xlnx.git F: Documentation/devicetree/bindings/phy/xlnx,zynqmp-psgtr.yaml F: drivers/phy/xilinx/phy-zynqmp.c +XILINX ZYNQMP SHA3 DRIVER +M: Harsha +S: Maintained +F: Documentation/devicetree/bindings/crypto/xlnx,zynqmp-sha3.yaml +F: drivers/crypto/xilinx/zynqmp-sha.c + XILLYBUS DRIVER M: Eli Billauer L: linux-kernel@vger.kernel.org