From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011032.outbound.protection.outlook.com [52.101.70.32]) (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 319A836B07D for ; Mon, 9 Mar 2026 20:56:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.32 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773089769; cv=fail; b=WTy1ZkJVu0il2ndLE8ovn+dbfHsFJZqzSzE023p3JdM/7lWLYRcb8qeVo74OsZc9uRcyLNtfbwEDhuVi+2xbCsT3q5HBHCyZpmVyA8rOryNGvtwd9BuyU6wTp4+3ljWgpiD69Lf2dxp/wQ4sqIiZxF/hNp/f0vEo1L60BNzop1k= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773089769; c=relaxed/simple; bh=1BNpoz7yCgckBSgzGLL1gAPmsYh8SkxOVnaSSr0rgo8=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=UCw9AsiQtT7ml0d+wk9kqJ4qcEqsCDC+lZdAj1LtmmJBzbyA8oK6XILNOpvdkMImT2r7VpVIy1SWHpmyTv8Uv9TWYnmHQ8ksB4YgPSGXVoogy9ySKjZUiGEr2ovOxoohPBqiliBBpTjDgvlDqz+XPPXtVE///ZrHmCLOG47LaD4= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=K5NN88uk; arc=fail smtp.client-ip=52.101.70.32 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="K5NN88uk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CRfVLBjkc2qwd/QWCaEcKh2ysT2JeMsvZRjy2t9eSVp9YlBOhuGrPe8/AgAhpMXMYj7h8AGjCrbiANOswHi6jfDMGIA3VViDHlPJ3nV/omLvPuCcAi1nF3tW7rNJ0AjN16nYuNWGd+AW81qurFXTaPX7qG0oT8+8iAuK6iEXYX731RZtGvLRnPGd1cT5pRcs1yEWnod+kOyHlS6dpk1TXDD0EWh9yF9JkLXwtrZ8MtKFiZLN1eqQrcqhPCycdPRO7nLYpzLVoLXmdelg2/pHUohFYdgMpCzG6QMjz7rLSA/W6lKXhMAoeTVtb4aRXS3upDXHRK4EuElJ7D/skF7ytg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=yo4Iu7pqNqeY18plYbnsoXWkHfxiMtT6Jwt3m7mNkjo=; b=DbspywBXP0m2kC287sz5N6qwl7KYHKtwUHtSWd2tWT1iW9ZDxw/0R/a6Gl0kbtSqB5BH5KCVgDThP67Z5ABjkOI9Mx6qY0DFQKH4r6wEcSEJ/EhzpRT+8Io64BmN/O+c42b31jd2nsWMuxEclBU5hSPjaP2wP6+pKGNQUIaW6tD7Ml0RQqgVHeFs1SuZwiWU3k2LfNKiJDoONnP4JkS/S1q4EcBgos7WexAkrvvPsE5GD6AKDit+qHge8Jdh0gFXma+mSgAD35jw6I1DgcM7RRMGgs6oZ2MmPrt5rxmjuZ8nN8HfgK3SZAINbbvinyFAfAX6Nfs3En8HOww+sIg4Fg== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yo4Iu7pqNqeY18plYbnsoXWkHfxiMtT6Jwt3m7mNkjo=; b=K5NN88ukVgQvTwvov8ogBfvusRmrfOUugBf/O87jBFfkm9iDqQunLq2YBYEEwueBIkEMZMtER+IgXkbZU/ERPrBos64sjj5l1OFDzyE2QVQZWtL7CQR3T6MorhnGGNi/JNvScJJ3MSot4tA3YHVZMDZf7NAcTdJXA8J359EVfvRgj8HNyZcawZWzAP1O/Fuefa99GJJWIkjvhgABpzOu83E8WIhO/k+bwKEMFVQtiRJAnuHkEnm9w89hF4NeoWb5+7hDUepQgUcmyAK+uKfkr6lJg4bU0bcv3DXrptNTvwJA9nu/fSYBaBZoR75nMloTUEvzXM5a7k3YB3uiFhZe/w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) by DBAPR04MB7335.eurprd04.prod.outlook.com (2603:10a6:10:1b1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9678.25; Mon, 9 Mar 2026 20:56:03 +0000 Received: from PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::b4c0:6119:2228:2ceb]) by PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::b4c0:6119:2228:2ceb%4]) with mapi id 15.20.9678.024; Mon, 9 Mar 2026 20:56:03 +0000 From: Shenwei Wang To: Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Mathieu Poirier , Frank Li , Sascha Hauer , arnaud.pouliquen@foss.st.com Cc: Shuah Khan , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Pengutronix Kernel Team , Fabio Estevam , Shenwei Wang , Peng Fan , devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com Subject: [PATCH v10 0/5] Enable Remote GPIO over RPMSG on i.MX Platform Date: Mon, 9 Mar 2026 15:55:27 -0500 Message-ID: <20260309205532.1794202-1-shenwei.wang@nxp.com> X-Mailer: git-send-email 2.43.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SA0PR12CA0016.namprd12.prod.outlook.com (2603:10b6:806:6f::21) To PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) 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: PAXPR04MB9185:EE_|DBAPR04MB7335:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b8e03b6-6aa1-479c-580d-08de7e1e46ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|19092799006|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: yG7cJ96dM+YyAv+wgW/0EU5AizpyOr2e7QMAgTs3ngTHX/17kRfWYrRwDF1yZsJmQkCGxYFnZvSBbkmc/dJVpPmiVysbi71bZCKbfjcnQ9efy6ZUfqZlBqJaIuzBxoqy67U/71DulL6UjUEv7ErZhTLtdD5JSeZuAcgqVLRFPRhME4aigbIvqmE5SycdsU6LQuFRYbeagyY72pr/gCaJiXMms++hjWPzX4kIi+2VqisDVj7g4EGkoFX96VyCUw3nfeO3wALD81Wvd60G+BkhphbC0MjdTmrYWKOo8kCEMAkqfQmq5oxZwFWB/pAcs4d7x69MfqZJ/i29IUXHkI63Xx0Jt2NrhwBiNYJevYgxVjg4k+upev8qEzGGDYw70sgU/04MC5xV7lm7ChYNvcwTebijqpWDKoe5nml7Kd3Cb9qzu0ilLPL1xCHtLZ+M8ZFfsT5j9C+03ovCRx1JVMle50t1GOrWlIro674C04ePz2fFR8K+JxxtoPcG1IijPbgkOm7zg/Knr6T14lWj4bBlpo3AfH2E13plLmvcGV0+9kTy9QAUJGTH3B/mGJIhLXjcErjO7o29D3KqmFHmaBP/MKcg4Z8RTviE2/3moAaO3TkS6BrwWgvN12y7eLoPLi0kI9oVEeVFy0OmvMiGuo3qG9Nhs7AxULXU2uympIwrpy7shR9zPlvur1D5Yzz42wNcZMPnLkQo6S0tJvXRkwZVOaK/tOjczS8vLsIJTLY63d0iFsAwhzzrOV3RoyKRWJmmG82TMYWiK6vUEaJ5NLwOtnPBMK5ZpoxQ5+UJV8tnHH6jPPXnJ/jMP6HTy5K9B6qy X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9185.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(7416014)(19092799006)(1800799024)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?WpvzUtPj5FC6CCUlocKFNuMErUIWeSOjSO5rvbclWShkHH2uUfLryI5NfTna?= =?us-ascii?Q?AOegN6VDrUntSnzok0HDYdcZRE+TcLxd76oW8RuojfQA4Fk0VpCP9y57sL/l?= =?us-ascii?Q?bcSDO29sy7onnMFbaWTIRZ8XlxGjcSDW0tL5h9TIGpMglh/x+nvwWutuyrM+?= =?us-ascii?Q?8Ywpq4tzjlj0qreq1mcuU1CpLAzMx1ZB1DovtCcM0R4ihbru7P5Ikjbn+Pm0?= =?us-ascii?Q?pbFHrDOw2AJ27vmmc+x5oTj0PkCeagOBjl998SG+Ha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EpvqtYMnDYUSpnXvm8KJ2SeVVU6bGU2IqyE0JCjyBuXpP4?= =?us-ascii?Q?MUdTvX+/EsXMnVzUW3Wg/bD3SyETfK3YYiP+HRo3DtfNyGlIHND3hM3BK2KP?= =?us-ascii?Q?zeDzvCGmlLtaoF0sIMmom4GPWbIhH4kAKc6ZyahbTcXfAIuMfrJ2MVlHqlcx?= =?us-ascii?Q?Qe1rre5TvaCMF14UqYckdQ+VMHaLZQ4YAf08pNWcUyUuJeSOHXDOVzFHi7cr?= =?us-ascii?Q?XATHjqkyMSBqyQuOtcn61m8xvRxdhijeSk0Yt8Mq43laOJA26DRGhG7SqGik?= =?us-ascii?Q?USbI5VK4CexHmzUdBL93rprcyvbqKPpEOGzmC456DGZIz29acTVgCeZ+aW5/?= =?us-ascii?Q?gAiQAa3me8apVWCTvVHNixtt1FrCEqUGEGtT91rnO6X2AXRE1oeY1JSah+Qi?= =?us-ascii?Q?7QvWADnGoBquFgS7q5aE/wVSetEj5tPABS7nNymotQ4kzV222jP/SIHs/YEd?= =?us-ascii?Q?6pRpum8L+t6J3E0poEPSBldTJu8uAWumTnTi4obzrQSgSyVtSWQzx9DkwUWQ?= =?us-ascii?Q?ChlgYKLvPdfM9WyBYRpE/1U4RW3NNof9RwLwynvcL18wx+fXN4GxjTboQb7Y?= =?us-ascii?Q?XYFCEQ6TPA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b8e03b6-6aa1-479c-580d-08de7e1e46ab X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9185.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2026 20:56:03.5333 (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: vf2JSWHzkwCXlXLIhzIToMxtu8mHERSHBUU2taR+oqvA5mz80rR0RYzsrsbjv+w3XKcw1RgXjrLz7gOT/tI1hQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7335 Support the remote devices on the remote processor via the RPMSG bus on i.MX platform. Changes in v10: - Update gpio-rpmsg.rst according to Daniel Baluta's review comments. - Add a kernel CONFIG for fixed up handlers and only enable it on i.MX products. - Fixed bugs reported by kernel test robot. Changes in v9: - Reuse the gpio-virtio design for command and IRQ type definitions. - Remove msg_id, version, and vendor fields from the generic protocol. - Add fixed-up handlers to support legacy firmware. Changes in v8: - Add "depends on REMOTEPROC" in Kconfig to fix the build error reported by the kernel test robot. - Move the .rst patch before the .yaml patch. - Handle the "ngpios" DT property based on Andrew's feedback. Changes in v7: - Reworked the driver to use the rpmsg_driver framework instead of platform_driver, based on feedback from Bjorn and Arnaud. - Updated gpio-rpmsg.yaml and imx_rproc.yaml according to comments from Rob and Arnaud. - Further refinements to gpio-rpmsg.yaml per Arnaud's feedback. Changes in v6: - make the driver more generic with the actions below: rename the driver file to gpio-rpmsg.c remove the imx related info in the function and variable names rename the imx_rpmsg.h to rpdev_info.h create a gpio-rpmsg.yaml and refer it in imx_rproc.yaml - update the gpio-rpmsg.rst according to the feedback from Andrew and move the source file to driver-api/gpio - fix the bug reported by Zhongqiu Han - remove the I2C related info Changes in v5: - move the gpio-rpmsg.rst from admin-guide to staging directory after discussion with Randy Dunlap. - add include files with some code improvements per Bartosz's comments. Changes in v4: - add a documentation to describe the transport protocol per Andrew's comments. - add a new handler to get the gpio direction. Changes in v3: - fix various format issue and return value check per Peng 's review comments. - add the logic to also populate the subnodes which are not in the device map per Arnaud's request. (in imx_rproc.c) - update the yaml per Frank's review comments. Changes in v2: - re-implemented the gpio driver per Linus Walleij's feedback by using GPIOLIB_IRQCHIP helper library. - fix various format issue per Mathieu/Peng 's review comments. - update the yaml doc per Rob's feedback Shenwei Wang (5): docs: driver-api: gpio: rpmsg gpio driver over rpmsg bus dt-bindings: remoteproc: imx_rproc: Add "rpmsg" subnode support gpio: rpmsg: add generic rpmsg GPIO driver gpio: rpmsg: add support for NXP legacy firmware protocol arm64: dts: imx8ulp: Add rpmsg node under imx_rproc .../devicetree/bindings/gpio/gpio-rpmsg.yaml | 55 ++ .../bindings/remoteproc/fsl,imx-rproc.yaml | 53 ++ Documentation/driver-api/gpio/gpio-rpmsg.rst | 266 +++++++ Documentation/driver-api/gpio/index.rst | 1 + arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 25 + drivers/gpio/Kconfig | 32 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-rpmsg.c | 743 ++++++++++++++++++ 8 files changed, 1176 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-rpmsg.yaml create mode 100644 Documentation/driver-api/gpio/gpio-rpmsg.rst create mode 100644 drivers/gpio/gpio-rpmsg.c -- 2.43.0