From patchwork Mon Jun 17 07:29:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13700276 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2066.outbound.protection.outlook.com [40.107.21.66]) (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 758301836E1 for ; Mon, 17 Jun 2024 07:32:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718609576; cv=fail; b=DXYmHgLbKKpyrZNdmPrhiWZVnO4iiRBbBbp6kVVvYo2Lmo4WMYcB1mFcyONyLFewvUl+JHTLfvXuxqPHgPrELs7VDR+Nrit1AOR16MQdnD/TzBF+dQmH5KdBXknEp9c7O1lHJ9IXahiR6HcSv30Qubxxo8kYI2i8yn+iT6FuRhg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718609576; c=relaxed/simple; bh=e8DPdXKiYK20vXagi7Yems9WtvwM/X4mJ0RYdgZMFC8=; h=From:Subject:Date:Message-Id:Content-Type:To:Cc:MIME-Version; b=spYcChMqmz8uSkDiToF2S84sb3VMuVvAIDZgLUrm0GhfbGKmQuHfWoYnGS66eqFCd2QNLRUt7JcXEIjso8rMoOl0ZY1UwcVqNpE/6K4I2uNSsQstZWaTJcXKxzPHa78eReoygVHdTQh53zX4QzGseh0N+LYTIHIHdEUmA+NKqbY= 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=pA7zfFfL; arc=fail smtp.client-ip=40.107.21.66 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="pA7zfFfL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U66CqyLC/hqiNN9+UyFhQmiqVHaOpxQACaLXgzaw6uXeU0mpo3WqTbBHwWPFPKHRkJXR/xMzNtEqSKFPHm0rII6/zg316aKsD56dygquy/c4bYFl4LGhZQhKhOrITmKeOHZorxRXIQ0/4QrvBvSlm1CxbxLMmVcK8Cd+CXAq2y+M/tXvwe+kzLeFCwVA4RWZ/IqKh1n3R2wmEFWPvBSlVI4ob/1YmUInTedQqBFyuG0X634a7js+J1zpG0IZkpBJbVTQ39/eglVKXYynDnSE2YMREhVuFgXsOOaexk7yARzumnA/5zUX7MzTeWEUIt8TxzHC8U6puLKDSOuosMxjBA== 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=3Y6RS8BIQYgU16HVAQi77pSBgQVo9ZsDIWr480ZeY+Y=; b=Uux5np81g8joe9Qaotvj1NQtsRnkEQpw3VgQQH4HVeUUECECPsbTlKLh0luUBryGiFfv0bNJAHqPWYsrjCS3t748U8f7qSh4WaJA7/gYfUudP4m+PITsbSJffOMfVZK7MTG1ToJ8nKGkviIzUL2OnDPoTYKxB9OqwFFjIzQL+f4OVWJQJAGSsqYcKavAbIVU73hXgIoHBii46YK+jY99/iS2YtwVPzDoXDcxDnRo7qOQRUW23zYygAIeLpxNRerQn9QUcDiH+XDRYKvvp8jB3YVsJwgwES1T9iOaMiA2RRo21/qE3MWa8aHGXk9a374ySinAFv4KetT6lJ0NqkpZYg== 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=3Y6RS8BIQYgU16HVAQi77pSBgQVo9ZsDIWr480ZeY+Y=; b=pA7zfFfLpWygPm9kVeS0OVb39antTvUA0FKCfrUrvlMZXOLOFPiEm8TdzivQg5ZAnFles3PMT/KSyZ6HwW8K0oniqHcuYRadPR/6ad9XDun+v5JgHP2V9WwE3Qz6nUsAyZi/9Rz+ihmha8OBa6S0M8wPJ3QqjjM9B9GanYhDc/o= 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 PA4PR04MB7982.eurprd04.prod.outlook.com (2603:10a6:102:c4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 07:32:48 +0000 Received: from AM9PR04MB8604.eurprd04.prod.outlook.com ([fe80::e751:223e:aa3d:5827]) by AM9PR04MB8604.eurprd04.prod.outlook.com ([fe80::e751:223e:aa3d:5827%3]) with mapi id 15.20.7677.030; Mon, 17 Jun 2024 07:32:47 +0000 From: Pankaj Gupta Subject: [PATCH v3 0/5] Communication Interface to NXP secure-enclave HW IP like Edgelock Enclave Date: Mon, 17 Jun 2024 12:59:38 +0530 Message-Id: <20240617-imx-se-if-v3-0-a7d28dea5c4a@nxp.com> X-B4-Tracking: v=1; b=H4sIAOLlb2YC/02Myw7CIBBFf8XMWswApRVX/odxQYDaWfQRMKSm6 b87bUzs8tzccxbIMVHMcDstkGKhTOPAoM8n8J0bXlFQYAaFqkKDjaB+FpnXVrgK0Ri0Ovga+D+ l2NK8tx5P5o7ye0yfPV3ktv4qEg+VIgUK1Xjj6qaysg73YZ4ufuxhaxR18JQ+eoo9ltogr9YZb f/euq5flqWK39gAAAA= To: Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Pankaj Gupta , Rob Herring , Krzysztof Kozlowski 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 X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1718609402; l=9603; i=pankaj.gupta@nxp.com; s=20240523; h=from:subject:message-id; bh=e8DPdXKiYK20vXagi7Yems9WtvwM/X4mJ0RYdgZMFC8=; b=4pOcVGAYQtq5LEkG2S7KDGVFETHI9h2JOG6gUlV6vPtha5jIOBGxt7deAkC0D8zC+kazPjW5Q v6IrsUTVw8kBpUoG5gJz3pmxKxSDlL4PS85BylUNgwxyF/uUHJzyaoE X-Developer-Key: i=pankaj.gupta@nxp.com; a=ed25519; pk=OA0pBQoupy5lV0XfKzD8B0OOBVB6tpAoIf+0x1bYGRg= X-ClientProxiedBy: SI1PR02CA0036.apcprd02.prod.outlook.com (2603:1096:4:1f6::20) 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_|PA4PR04MB7982:EE_ X-MS-Office365-Filtering-Correlation-Id: d00b307e-4701-4b38-b13a-08dc8e9fafab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|376011|7416011|1800799021|366013|52116011|38350700011|921017; X-Microsoft-Antispam-Message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hcrD/KkjAZ/x8zXiTFmu88Wruwqf1PI+RfZz+3ZcxINL0MzO/pJRUegG1mN5?= =?utf-8?q?ul5bb1wkuRWb2g96KZPzvGJjm0C7lpElWNJb5e/qJNpfie2uU/0k1wZAdFuog56ah?= =?utf-8?q?HIznoAGPuXhHedad0Ys1cU9EaYvI5rMFRqaO8BjNO9IuEokXTbTXM8kF/wfX5/knc?= =?utf-8?q?Zmckl5+9TDLom+zmagHsxf57xnyySB2XwVXDpUGWQGvDcBSG20XbEeg1dgEIHUBod?= =?utf-8?q?z2xcLs7QmcfCqWKPfVVU2MRWjdPMAihBHYmKNaev1wVNPJdQtgfvRXd4hbyQX2x4j?= =?utf-8?q?RKjVz7kmxBkH8g2MDZQikhFllJY9pM0Sg8p8SSJaKAKgVGyxOzyb9Y/21McttebEV?= =?utf-8?q?3NGqsEGwgZYvjYHfoJcJlwA7uJt5xfcQPs++hlHe+soOVvG8W23LnPoES+WtRBnYT?= =?utf-8?q?3n0zp7vbxIkbsTaOpC6X/5PvVdfvv2Mzg7g=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:(13230037)(376011)(7416011)(1800799021)(366013)(52116011)(38350700011)(921017);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?5BWs4I8d//mm5U+byZDRVFjuyWXD?= =?utf-8?q?kLtzASP6Xxv+y+xpBrF945NJmtKyVdchA/aJSLU+UBNmus48JbMXD7muANc5YULFe?= =?utf-8?q?szM8TmScEJPcrFLpGZjsb2lLBu1AG13FwE7f0xdHtypyJo3TV+AiLNPz/Q5oDPpf0?= =?utf-8?q?FyCaQwuIw0qVbBk5u7tXgXGjNSytTWZgB0/UZ9Q35xy4p3tKLt0mEzJqXt2/fHSpo?= =?ut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8?q?WoPD1sQ4ZgpGimaqQUxYms6w529hVEzeNU5wcRqD/HMGlV/CjTsf1GFkaTDjHK7mC?= =?utf-8?q?ZgSxnuV7XXWglflMVdd+A6TY05d7qkLu8G7BH233RRVVvFaXkpx9VMw0wVCqeydPp?= =?utf-8?q?NZ04FYm8j7SzzFjgqElBXwfMUNCH5tdWYiiJZOPqvVVJV/BmQiz7BSZLD0bP4q63B?= =?utf-8?q?9dktAg94kbZMkqVyGZ5hfZiPGAV+r0+An3z1yKIT8IOMkFYAhRWxySRjdzjWWdOJF?= =?utf-8?q?rPmzrkieSK8eAxY3QCiPaxCV9+OJXwtiC7z77d+6UR0ggsTeB3y+JPXk0NnyFKorX?= =?utf-8?q?nEvPnDRS9gGKs+VspxQu27kp78TlkyTrlXWSDX+qcaYYQeAi71TZ0PqX7FKbKD1Yc?= =?utf-8?q?IoDPgTc0tCkF969BqKLewX0F3N434gRNnsv6V+R/ASj1SgluuCgqgcdVPn0XUgok4?= =?utf-8?q?rGU1lgYz52ZE?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d00b307e-4701-4b38-b13a-08dc8e9fafab X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8604.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 07:32:47.9345 (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: fwXsBuAVm5ZKGVTlbMvTOj1pDa977smyxcwd3yITCEXMZvMO39XBgGPpD3VDMPWP8XiVcx/M411c/0CA8LEk7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7982 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. To: Jonathan Corbet To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley To: Shawn Guo To: Sascha Hauer To: Pengutronix Kernel Team To: Fabio Estevam To: Rob Herring Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: imx@lists.linux.dev Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Pankaj Gupta Changes in v3: 5/5: - Initialize tx_msg with NULL. - memdup_user() returns an error pointer, not NULL. correct it by adding check for err_ptr. - new IOCTL is added to send & recieve the message. - replaced the while loop till list is empty, with list_for_each_entry. - replaced __list_del_entry, with list_del. - Removed the dev_err message from copy to user. - Removed the casting of void *. - corrected the typcasting in copy to user. - removed un-necessary goto statement. - Removed dead code for clean-up of memory. - Removed un-mapping of secured memory - Passing se_if_priv structure to init_device_context. - Updated the below check to replace io.length with round_up(io.length). if (shared_mem->size < shared_mem->pos|| io.length >= shared_mem->size - shared_mem->pos) - Created a function to cleanup the list of shared memory buffers. - Used list_for_each_entry_safe(). created a separate functions: se_dev_ctx_cpy_out_data() & se_dev_ctx_shared_mem_cleanup() 4/5 - Changed the compatible string to replace "-ele", to "-se". - Declaration of imx_se_node_info, is done as const in the whole file - Remove the unused macros from ele_base_msg.h - Remove the function declaration get_phy_buf_mem_pool1, from the header file. - Replace the use of dmam_alloc_coherent to dma_alloc_coherent - Check for function pointer, before calling the fucntion pointer in imx_fetch_se_soc_info - Removed the unused flag for SE_MU_IO_FLAGS_USE_SEC_MEM. - Removed the unused macros WORD_SZ - instead of struct device *dev, struct se_if_priv *priv, is used as argument to the funtions:se_save_imem_state, se_restore_imem_state, imx_fetch_se_soc_info - Removed ret from validate_rsp_hdr. - changed the prefix of the funtion: plat_add_msg_crc and plat_fill_cmd_msg_hdr. - indentation correction for info structures. - remove the check for priv not null from se_if_probe_cleanup - Removed the casting of void *. - se_load_firmware function is corrected for not freeing the buffer when allocation fails. - Checking if get_imx_se_node_info() can return NULL, in se_if_probe() - imem.size has type u32. return value from se_save_imem_state() will be assigned to imem.size in case of success only. - removed the flag un-setting in case of failure. priv->flags &= (~RESERVED_DMA_POOL); - removed the function call for devm_of_platform_populate(dev); - Checking for not-NULL, before calling the funtion pointer se_fetch_soc_info. - Removed the checking for reserved memory flag, before freeing up the reserved memory, in se_probe_if_cleanup. 3/5 - Changed the compatible string to replace "-ele", to "-se". 2/5 - to fix the warning error, replaced the "-ele" & "-v2x" in compatible string, to "-se". - Added an example for ele@0 for compatible string "fsl,imx95-se" Changes in v2: 4/4 - Split this patch into two: 1. base driver & 2. Miscdev - Initialize the return variable "err" as 0, before calling 'return err', in the file ele_common.c - Fix the usage of un-iniitialized pointer variable, by initializing them with NULL, in ele_base_msg.c. - Fix initializing the ret variable, to return the correct error code in case of issue. - replaced dmam_alloc_coherent with dma_alloc_coherent. - Replace the use of ELE_GET_INFO_READ_SZ, with sizeof(soc_info). - Replaced -1 with -EPERM - Removed the safety check on func-input param, in ele_get_info(). - fix the assigning data[1] with lower 32 address, rather than zero, for ele_fw_authenticate API. - Correctly initializing the function's return error code, for file ele_base_msg.c. - replaced 'return' with 'goto'. - Use length in bytes. - Corrected the structure se_msg_hdr. - Moved setting of rx_msg to priv, into the function imx_ele_msg_send_rcv - Will add lockdep_assert_held, to receive path, in v2. - corrected the spacing at "ret = validate_rsp_hdr" - FIELD_GET() used for RES_STATUS - Re-write the structure soc_info, matching the information provided in response to this api. - The "|" goes to the end of the previous line. - Moved the locking and unlocking of the command lock to the caller of the function. - removed the safety check for device private data. - Structure memory reference, used to read message header. - In the interrupt call back function, remove assigning waiting_rsp_dev to NULL, in case of response message rcv from FW. - do while removed. - replaced BIT(1) for RESERVED_DMA_POOL, to BIT(0) - The backslash is removed while assigning the file name with absolute path to structure variable.fw_name_in_rfs =. - Update the 'if' condition by removing "idx < 0". - mbox_request_channel_byname() uses a "char" for the name not a u8. Corrected. - devm managed resources, are not cleaned now, in function se_probe_if_cleanup - Used dev_err_probe(). - Used %pe to print error string. - remove "__maybe_unused" for "struct platform_device *enum_plat_dev __maybe_unused;" - used FIELD_GET(), for RES_STATUS. Removed the use of MSG_TAG, MSG_COMMAND, MSG_SIZE, MSG_VER. - Depricated the used of member of struct se_if_priv, bool no_dev_ctx_used; - Moved the text explaing the synchronization logic via mutexes, from patch 1/4 to se_ctrl.h. - removed the type casting of info_list = (struct imx_se_node_info_list *) device_get_match_data(dev->parent); - Used static variable priv->soc_rev in the se_ctrl.c, replaced the following condition: if (info_list->soc_rev) to if (priv->soc_rev) for checking if this flow is already executed or not. - imx_fetch_soc_info will return failure if the get_info function fails. - Removed devm_free from imx_fetch_soc_info too. 3/3 - Made changes to move all the properties to parent node, without any child node. 2/4 - Use Hex pattern string. - Move the properties to parent node, with no child node. - Add i.MX95-ele to compatible nodes to fix the warning "/example-2/v2x: failed to match any schema with compatible: ['fsl,imx95-v2x']" 1/1 - Corrected the spelling from creats to creates. - drop the braces around the plural 's' for interfaces - written se in upper case SE. - Replace "multiple message(s)" with messages. - Removed too much details about locks. Testing - make CHECK_DTBS=y freescale/imx8ulp-evk.dtb; - make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8 dt_binding_check DT_SCHEMA_FILES=fsl,imx-se.yaml - make C=1 CHECK=scripts/coccicheck drivers/firmware/imx/*.* W=1 > r.txt - ./scripts/checkpatch.pl --git <>..HEAD - Tested the Image and .dtb, on the i.MX8ULP. Reference - Link to v1: https://lore.kernel.org/r/20240510-imx-se-if-v1-0-27c5a674916d@nxp.com - Link to v2: https://lore.kernel.org/r/20240523-imx-se-if-v2-0-5a6fd189a539@nxp.com --- Pankaj Gupta (5): 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 firmware: imx: adds miscdev Documentation/ABI/testing/se-cdev | 42 + .../devicetree/bindings/firmware/fsl,imx-se.yaml | 160 +++ .../driver-api/firmware/other_interfaces.rst | 119 ++ arch/arm64/boot/dts/freescale/imx8ulp-evk.dts | 17 +- arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 14 +- drivers/firmware/imx/Kconfig | 12 + drivers/firmware/imx/Makefile | 2 + drivers/firmware/imx/ele_base_msg.c | 284 +++++ drivers/firmware/imx/ele_base_msg.h | 90 ++ drivers/firmware/imx/ele_common.c | 382 ++++++ drivers/firmware/imx/ele_common.h | 49 + drivers/firmware/imx/se_ctrl.c | 1230 ++++++++++++++++++++ drivers/firmware/imx/se_ctrl.h | 148 +++ include/linux/firmware/imx/se_api.h | 14 + include/uapi/linux/se_ioctl.h | 94 ++ 15 files changed, 2654 insertions(+), 3 deletions(-) --- base-commit: b63ff26648537a5600cf79bd62f916792c53e015 change-id: 20240507-imx-se-if-a40055093dc6 Best regards,