From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from MRWPR03CU001.outbound.protection.outlook.com (mail-francesouthazon11011004.outbound.protection.outlook.com [40.107.130.4]) (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 D7B13309F1B for ; Thu, 12 Mar 2026 19:30:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.130.4 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773343830; cv=fail; b=buaLgZjjyRNYHVKz+fzEJXSJ8/XnorOEgWb6zpJ54C+6IM+GXiVlOTfV2yLtHUQnCPWlWf8Db2acaqKejJCQpFWkoCY6pBDz+3saxZN7CTgBb2UI/UAsoqurTxEWyUouxr1xSOj1j0MwZt8cjVQbQvJUMqXct2MfBwu1I2nw69E= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773343830; c=relaxed/simple; bh=cjqBbWcdCMuhUuVqiwOpSUhXMq2WzDp/CE/JpGxcnN8=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=BY992HQfOdl4jlw4ul8594umaC86d+ZGcBjvHFNnRRe9fdH9+QM+Gb54iPBas/ClU9ALbIKoDj7U7Lax/l5QWiv7L8/9jpT8fzFDlXEpmesMVK/aklBYwV4zd8E0udjkz49VGgyTCr34RvX/ddYfVrpjnZBJmayOj/rF9kF6b4U= 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=dlIPYi8M; arc=fail smtp.client-ip=40.107.130.4 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="dlIPYi8M" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ym1M8GMGSvIvyizOgDBiIvALxge9DtwA7WDWWj4Wd9C6r1O3JwatXc6323Zru2P9Y6Rb9XrpZLzRK1JK5+UPTd1CGZ+ulbSFBGHQrQU0UilTKc7L5vMsPfhF0BwrGzdFCucXHKqQAOAdzVETy6fa0EHdBt9qTmX6EDF8Xl/eWuhi9Eoc6jJPBntOLQE+244hfbGaDk8n+EzlAmTawfcecqvCdRGUX3+HVicUT38afoqbmLX8HUdMPqMvoF63j4cAtZfK4mOxSioCPxr/Tpdt1HInku1lW6sqvceMhdG93niztcxLcuCMFrcvmDFDMawqam9/8ptxZaHGmGiumMLE4g== 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=EPlZrz9Dy904P9cBe9G3YYavqJB7sgrkzDcRXC7e01k=; b=c2EHblUBdZF/qHVpqytcFALH1Yc/EEFqD6C2CbVMdYvMUG2iGUzJOfLyab4dkNd021tKbatV+SxDATHEe6adpaPgg6GyoSVTe6mZXbvvwtHt+uJA/gL3g8LfiY4sB6iTiE5u+sIedg7p/sIbPLjZvCb5ufQjdEku0QPv/oa93ZTHPS1hCddw62VzvIAEHskoTJ+4Lq68R3UG6NOpSLC0XXJADay0GshxEUAYpo/VXLeU6b9vUeXD1T4MoIK3T4Rq6L6NUSWMXZE+W+KL3/wVQ3TeY2+4BJfDoZYi+RMWhRd4a0WZBnwiMC6QU5LPKmKamfrJRxC/3awIvaxP89jhlA== 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=EPlZrz9Dy904P9cBe9G3YYavqJB7sgrkzDcRXC7e01k=; b=dlIPYi8Mmr07w1w8rRslDYfEEpF30eUJ9JHVlhM7Bwquqv26Jie8R2/E9UjlzdlWNlGtFDOat8EZ8q9AouiaOWotHw86mewtY/7qj8wAV+SpjWlbcOQi46R8kJWLPWCcqd6sXPnR/WIou35BajVMGmCQQYimMAxiLxPKw6/7Zw9ebvX/DQS8k61UxROMSK4JWs+CGgrSHPOSyuNTEHIccXBJKFmdAyb5TLFuQHWEibuiaYVGphA6hxa9lfltnXPo0xftDVjsnzzGNqSgLCMgK7BF7x+2FJjuI8t4z5JheiGePK0fnjqRzhzhOArsNGHTUXlMl9KMKEaXfrNcepdy9A== 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 PR3PR04MB7468.eurprd04.prod.outlook.com (2603:10a6:102:8d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9700.12; Thu, 12 Mar 2026 19:30:19 +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.9700.013; Thu, 12 Mar 2026 19:30:22 +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 v11 0/5] Enable Remote GPIO over RPMSG on i.MX Platform Date: Thu, 12 Mar 2026 14:29:52 -0500 Message-ID: <20260312192957.1978329-1-shenwei.wang@nxp.com> X-Mailer: git-send-email 2.43.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SN6PR16CA0054.namprd16.prod.outlook.com (2603:10b6:805:ca::31) 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_|PR3PR04MB7468:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f8e6862-92ef-40dd-93fc-08de806dcdc4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|19092799006|52116014|7416014|376014|921020|38350700014|56012099003|18002099003; X-Microsoft-Antispam-Message-Info: oqen2ZjfL4XjHPbgELsGWh5ayRD5iTuOCYWFD3sOF1pvFURC1yD6T9jCPWHcdu9xMBLROZlR1v0aZyjvvo7xX8lgQc2RGxH/sNJ+0CyTU6RlB4gorbsGbB3qYdOSePL7+CGHFYhhUb0xR3rYK2Ai3AcYEe9RyFjl8KX3glcwK7GWhqrrlpy1navG91ntHwPSQCiyy6rlb4PNCjuTUYuEYCddhhvEHrQ/DQLix2V1so1XhHMyzJK7JtaMN4mNIoE1LHY9YZewWPXsEtQxKhBre+unqHnD4tKSKAo3+Ns2bauwDR06ZeDbN/4IPT6E+lIbBAaq+CgUfl5nqOuGdiKSo7xAOU31BLt2L/NkQ4b/CSiYO0ks57VJi9eiIjyImjPDxekG1+e/1JbG2Y0c879lAhQ56kR60G8sWg+F8aJVigwz7hies9NlRdSkIkp6f21qjCqd79LjZhhTjjcMF4R2vdqPpocUaNbz+TveNHobYpRrdghreHveZUPCiPvib4+MpiKvdAmVELJ7oURL41JSgqoJ7mTopqUX8S7e4Ap+vLjLih0NSJucYycO7lhDIl2DbxNTCcAN+8eZDH0PT2MrgR2zXd1bEXI34YR5s75PTi0/waHQpa2g3b6CKVV8ulFV/zyiUiJWtUNPQDCRocnoEcBtkE5I9mmgcfBWx9tPDFNd0iJUJs5eZNcW56Z6005aamCj4Z3CRQOlOVehZyNB44I94VPiMLixX7oYGPjtqa9M/1EOgX1GpQcnOXLKFZH4C28WZlKIShR+ej7d7Ui6ORlBhdwp5qTXXIB6mtWGsbe6oyNbWh0p94tejDweUWTH 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)(366016)(1800799024)(19092799006)(52116014)(7416014)(376014)(921020)(38350700014)(56012099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?hWutPH13jbd+leiDQAqWcetrYkGyJcMkyCvwjfzVWY1TxI7H7BpgmoOLtJ92?= =?us-ascii?Q?sWu/4K/HxJ+x5RoTb/xR/hjO1ZSRDcrvFAtpm4MEpansJ2EPXUMRtUIdart8?= =?us-ascii?Q?FlYYZ8YVgcd89xYKTEpXK2GS8wkWTwaVY7m+GlJssx66k2VO6KdJ1lNNEl5L?= =?us-ascii?Q?uirU125RZwOt+b4IF8G3xfuXaB/umgKE1pDJkqpeqJO8cvGPtGDV5i9oWxyj?= =?us-ascii?Q?3pDzyIKVqS7omTb+f/8qq7rB/7AZjH5h6WRmN278C8AFyvcDc5sZ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L1wToxQ22Lmn4zmFMT7V1E6laGb94jW9Tm4W9?= =?us-ascii?Q?nP/WjI8d4kb6NQPfQgBmzLW8WrpHbQZsRA0BWRMPVuNUEElDUnqXqZVyBxDd?= =?us-ascii?Q?tUoMN2RwxLkBKZgw0+lCNDcsEvjgmumVD6ofzy66818EdbECSisDAEmcdgKG?= =?us-ascii?Q?NSr/LDvrl6nL/XlzCxovvYgI+zPDXGQ4G7F+HhpfwhG9SU6ptLs69jWgjmGS?= =?us-ascii?Q?3iYh22Am2MjnJAqAwX/vbyExWh9yQQtUJ2xTtymxhJ3JZkUktFdhZLrExae1?= =?us-ascii?Q?9vrvauGLP8/G86Q08P3+T9qREjC88y3VXKI2poD6fc6ZqR6FSPZp9MLAKLZu?= =?us-ascii?Q?TluD+GPZoLHqbu6EjTSzFS0bQgi1WAz5IHEG2p7lIhOfIB/idHbtmRpjbZft?= =?us-ascii?Q?62tfP51RZ3SuomtUpwO9K4Yn3rb7CbL+sONoOvTNgNIT6YjFR/1hQCl3Ix85?= =?us-ascii?Q?qyz5vKNxlSjtgraRGSgfFMMXBI+3Qp42p21URCEOPST4sfDa+tNc9dR7KB5M?= =?us-ascii?Q?dMW8THD6n7ehDiMfj7HYn9W3p2r8u1CY+zG71ypa9IWsurWBKpHmlohSfQCd?= =?us-ascii?Q?jE/t0XyjSA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f8e6862-92ef-40dd-93fc-08de806dcdc4 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9185.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2026 19:30:22.7632 (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: 3Udz/nEMZqSvJKrBAJDC/r/Zf9idkTGXSN+/XSxO2LMOMHdBG6qJksse9E99RADj6Op12OpRT+kzm9FXqN91DQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7468 Support the remote devices on the remote processor via the RPMSG bus on i.MX platform. Changes in v11: - Expand RPMSG for the first time per Shuah's review comment. 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