From patchwork Fri May 10 13:27:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13661604 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2071.outbound.protection.outlook.com [40.107.8.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96E65127E0D for ; Fri, 10 May 2024 13:30:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.8.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715347802; cv=fail; b=YZE825J0FOsHmC5+8j/4Y3wkB6gJ+WvL5yfeTykxjF3GcP+4htWHb++mEKXmNC/rFpjspViF28L++2uuMTmYYxb3vgsUMra7GN5mP15ur2hfXcQihmPz6MhYbHESzdExOHsP++uBgxNSMTs1zE2jRVrmguWOXWXVhVPv83yJl00= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715347802; c=relaxed/simple; bh=f2ac9QRAicm5VDNnBecL5v4PUcq/Egt4zE6wms3i1gA=; h=From:Subject:Date:Message-Id:Content-Type:To:Cc:MIME-Version; b=u3AxLMO+Flug6hYYxJ8TBpsxLecncW0OTE766sSF4dAhsZSEW1UrTE5WQiWCHIFhGLS22Bfm4SxY+SQSAED6x65j2bJHH63hbr+7LXgmCnwCGjW9r1XwleSzyyrFP4rfujv8NPZVI6sxd39o1+P3wBcSLfXOXUBLgxKchT9RoTU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=sD2LSul0; arc=fail smtp.client-ip=40.107.8.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="sD2LSul0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UNwDUt9WXyqxaPk91R+3R7fLacG2fqb7AAR7/HfS/DDlhkfYUYTfwCXe8E1IKZQQMKB6gTyIX+wzqOXOyqLl9YKSK2wpAx/Fu1u7VIOvMoXuAFQnZ+ur4GgvMNn1M8fPTwamUS7uwiOm9dTJ6LTsljhGNKPcsqhaXDXaLL4lHDDLrqck0WWy22FCAXShoesF8fardGcpiYXDHlcjvIbRuGv5JMuIfOtFMVL8w1j7hOBGQi6p7yepsPs0/OrAGFrAZknGG62Nc5znn4KuExEejSCWa2sJAVz4CE1cZZFtAzgPayMuYnFn0DbUpgErof6uC2TqQJrUAsWYDfflZaHK2w== 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=o0rhxtrNBYZA/9j2JxNXzPtum/qEOv6Nkz5UlpI0iJc=; b=gFL6N30WZGt3WuK7AO7JdffNIb0LeuRDqgGa3loXWk8ubgMytZ9xDqoyiNc6xHZdmPopg1tg64IamzmFIETVDiH++/+X1p5v59OGk8PYYluzd/sLzuJ8IhKOyrewry7JnNPRuLWy8B9hNn1JDQALLeBcXkRKzL3NQnpOCNadPEQctha2FgUPhk7o+L7hdukYsU1OaOmnt7yWFYxoxLjbpcXKnrx6OWvZK5juwde6udncYRN0pLoXQ6v2xoBMGiDfFpM5WFfB7Rw20Ceqof+iEsRXQFx/71YB5fDH/Z2KVoHo/kUDCf7DuGjLi6cdIL99lJ2MLL89m8s29VYDkXtwYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o0rhxtrNBYZA/9j2JxNXzPtum/qEOv6Nkz5UlpI0iJc=; b=sD2LSul0x8mYcy+jBjNG8rPT7fuXVXKzumkRas0fo43m00UJJIA8pGPwfCAMs1cRQ3hUrRw6CDSGeeBVuNH4rYkIjwq+jWOZOr3b20zpGR5LuQKlhmCkArn9+fyPg+uDtaseRS2Qh0rPUIu0zbX8YHaFq+XyirwHziKhAzuOouk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM9PR04MB8604.eurprd04.prod.outlook.com (2603:10a6:20b:43b::21) by AS5PR04MB10041.eurprd04.prod.outlook.com (2603:10a6:20b:67c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.49; Fri, 10 May 2024 13:29:57 +0000 Received: from AM9PR04MB8604.eurprd04.prod.outlook.com ([fe80::e751:223e:aa3d:5827]) by AM9PR04MB8604.eurprd04.prod.outlook.com ([fe80::e751:223e:aa3d:5827%4]) with mapi id 15.20.7544.048; Fri, 10 May 2024 13:29:57 +0000 From: Pankaj Gupta Subject: [PATCH 0/4] Communication Interface to NXP secure-enclave HW IP like Edgelock Enclave Date: Fri, 10 May 2024 18:57:26 +0530 Message-Id: <20240510-imx-se-if-v1-0-27c5a674916d@nxp.com> X-B4-Tracking: v=1; b=H4sIAL4gPmYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDUwNz3czcCt1ioGiabqKJgYGpqYGlcUqymRJQfUFRalpmBdis6NjaWgA Vk2ItWwAAAA== To: Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Pankaj Gupta X-Mailer: b4 0.13.0 X-ClientProxiedBy: SI2PR06CA0003.apcprd06.prod.outlook.com (2603:1096:4:186::14) To AM9PR04MB8604.eurprd04.prod.outlook.com (2603:10a6:20b:43b::21) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8604:EE_|AS5PR04MB10041:EE_ X-MS-Office365-Filtering-Correlation-Id: 22e4ffe6-5ccb-41ce-fb63-08dc70f548d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|7416005|376005|52116005|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?3hRj18fIDsT5ZGDPWouDEdsu3HDZVOu?= =?utf-8?q?9Q64LSJQrzxL80hH2Gk6isi7C9hm0qVWjWhcCaBYWO6TqrSwVDzj24BUajweqLzK3?= =?utf-8?q?ItKvf5veCAEbrNO2AcLTYUZhOef3nk2ltE2TfJh8dfbwNs1hB7e7A03uDYi0ZVEK+?= =?utf-8?q?E8zRi9Gm+MQlrHIKq0/eFGInZ1UDDgagz2QES58UZou7vMEZoK2ou52m5yvSQjFC8?= =?utf-8?q?nnt2gYAAi2t29PwLB9QgvXsNaBNqpfHXRfbuOyTKyOoH6gprFnoIEbkPiPG2t/Xpr?= =?utf-8?q?E1OsGpuwCLBrk7rsjJhbOPQQuZ7yhT2eddYtisbBWm5xs71RCSSZM1O3O0mLGEU46?= =?utf-8?q?TkcoDTLgjzQVu2K++mEeN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8/d7THy3J6byL9KWnIUkOKM6rovohxs2NG82ZxPNAE4oTWcTXAP?= =?utf-8?q?Kbh35OPkpNTroWYchc+nNMerMBnLWZkoVcg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8604.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(7416005)(376005)(52116005)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Wae4GSyQx/FnxsJczqETAbkYcCQp?= =?utf-8?q?Ji4M1lbW1pB9s/rUu7Z6K1gzJNGcnclPQbRbIDYdSDbE8BdK+c14mdSLX+bH7Oj2Q?= =?utf-8?q?p2lUXiJborTlXlRXovi1tSFDo1JcTqe0KjbtRljdPEtWisgKC8MWUlwhmn5vMqSYs?= =?utf-8?q?ZRMZeOL2oIrhicy5JVczSHjMAQmx+4BMOvBlp8491p4+7bqSzfdpPbKNuOUdRyHYH?= =?utf-8?q?XFYM5sDprH9eYElna+Gx49/+SZ1LIOoE6wKK6V2cpx/CB3Htau25EEx/262TqqYJp?= =?utf-8?q?2UftVIV0D/Znp37+o/L0uEDsj1cwzVUWW2mBHeoQMB/Ivbj9qSHwHZfyEt5ATV5OA?= =?utf-8?q?v+91BpcESx64rhj/9ScgG3QjB6JLCWHop94V+ohAOsPC5ihyYgtBrRICU6oToBSnB?= =?utf-8?q?j2oydMOFewUCtLPibPxHbY+txCzV8OEjivknBaUA9QCHBn++dM/qGBu6HSIrLkZeC?= =?utf-8?q?vKL1Sn9qQHHN3RtdqoKjHyApUCpLY0FJQg6x6nAH6Dm8CIcDDqE8+4n57ubGjotBA?= =?utf-8?q?DMEcSkk3n5qC6BtsmqcK0kpuUZpND/uvLpynGMdp14FyWfoWrjfKT46/cDern7E9d?= =?utf-8?q?koBRBRL8OlmRZ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+Lwz/+66uvYsjISj6pUEfZ0DdlVEJh5dJIGA1jAum?= =?utf-8?q?3UjRZizuJiu8?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22e4ffe6-5ccb-41ce-fb63-08dc70f548d8 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8604.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2024 13:29:57.2321 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aNhcbg4xuE9KVK5CWEQAZA3oDl7d9e25szDIzlSvaNSNhbZfpsA3sSr2L32HXTuiQ/6AkiliL88urfEHm0eajg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB10041 Hardware interface of the NXP Secure Enclave HW IP(s) like EdgeLock Enclave, V2X, SHE etc, is based on the Messaging Unit module that enables processing elements like ARMv8 core, RISC V core, within the SoC to communicate and coordinate by passing messages (e.g., data, status and control) through these interfaces. The NXP i.MX secure enclaves hardware interface kernel driver, is specifically targeted for use between application core and NXP secure-enclave(s) HW. It allows to send/receive messages to/from the secure-enclave. Patch-set adds the kernel driver for communication interface to secure-enclave, for exchanging messages with NXP secure enclave HW IP(s) like EdgeLock Enclave, both from: - User-Space Applications via character driver. - Kernel-space, used by kernel management layers like DM-Crypt. Signed-off-by: Pankaj Gupta --- Pankaj Gupta (4): Documentation/firmware: add imx/se to other_interfaces dt-bindings: arm: fsl: add imx-se-fw binding doc arm64: dts: imx8ulp-evk: add nxp secure enclave firmware firmware: imx: add driver for NXP EdgeLock Enclave Documentation/ABI/testing/se-cdev | 42 + .../devicetree/bindings/firmware/fsl,imx-se.yaml | 186 +++ .../driver-api/firmware/other_interfaces.rst | 126 ++ arch/arm64/boot/dts/freescale/imx8ulp-evk.dts | 17 +- arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 18 +- drivers/firmware/imx/Kconfig | 12 + drivers/firmware/imx/Makefile | 2 + drivers/firmware/imx/ele_base_msg.c | 287 +++++ drivers/firmware/imx/ele_base_msg.h | 70 + drivers/firmware/imx/ele_common.c | 341 +++++ drivers/firmware/imx/ele_common.h | 43 + drivers/firmware/imx/se_ctrl.c | 1339 ++++++++++++++++++++ drivers/firmware/imx/se_ctrl.h | 151 +++ include/linux/firmware/imx/se_api.h | 14 + include/uapi/linux/se_ioctl.h | 88 ++ 15 files changed, 2733 insertions(+), 3 deletions(-) --- base-commit: e8f897f4afef0031fe618a8e94127a0934896aba change-id: 20240507-imx-se-if-a40055093dc6 Best regards,