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: 13661610 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F391FC25B74 for ; Fri, 10 May 2024 13:30:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=iAwdByGJ0nx8ixyOUVlNTrx0Y3x2ImxaKhIEHAHuQew=; b=cbwdvjsmr51rj6 hnQ5NShgmN6kas+E4VhMNYueFN5EE0cHlklW0JB7V5iQhR8EXOMqgduEJnFJVARP73CN4Z1KFQ4sn TVQhSOvhHUVOTZtRuelUB9EUB9hItiCUetAwtfNMfV1P5ns+vlt1cBw+TVZBa1TtXzGgCVWvtcOJX 8DNPwlUXLVZlmql0boMOjBDjcDSHa1lR1bHAYrdX3e3tDV2JDBpFsjg0MF7h0MJOikqswuy3Y/OQf +H/DH3J+brKgOASnD0j4aLtqYezwZoMQS1QAXib2yzeO9fclbW9ztCMhUvZiDWFJMh2iWWcl77Po6 tlyM+rzU/fdv+mEAHwcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5QK7-00000005OsF-2oym; Fri, 10 May 2024 13:30:07 +0000 Received: from mail-vi1eur04on20601.outbound.protection.outlook.com ([2a01:111:f403:2611::601] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5QK4-00000005Oq9-2lzS for linux-arm-kernel@lists.infradead.org; Fri, 10 May 2024 13:30:06 +0000 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) 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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XC?= =?utf-8?q?983CKTxZvnfQKm8/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/cDern7E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?q?fIhjyP63usrDpq5QO7PBg3/B+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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240510_063004_780934_3C45AB3A X-CRM114-Status: UNSURE ( 9.50 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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,