Re: [PATCH v9 4/5] gpio: rpmsg: add support for NXP legacy firmware protocol

From: Shenwei Wang

Date: Fri Mar 06 2026 - 11:34:55 EST




> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Friday, March 6, 2026 8:24 AM
> To: Shenwei Wang <shenwei.wang@xxxxxxx>
> Cc: Linus Walleij <linusw@xxxxxxxxxx>; Bartosz Golaszewski <brgl@xxxxxxxxxx>;
> Jonathan Corbet <corbet@xxxxxxx>; Rob Herring <robh@xxxxxxxxxx>; Krzysztof
> Kozlowski <krzk+dt@xxxxxxxxxx>; Conor Dooley <conor+dt@xxxxxxxxxx>; Bjorn
> Andersson <andersson@xxxxxxxxxx>; Mathieu Poirier
> <mathieu.poirier@xxxxxxxxxx>; Frank Li <frank.li@xxxxxxx>; Sascha Hauer
> <s.hauer@xxxxxxxxxxxxxx>; arnaud.pouliquen@xxxxxxxxxxx; Shuah Khan
> <skhan@xxxxxxxxxxxxxxxxxxx>; linux-gpio@xxxxxxxxxxxxxxx; linux-
> doc@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Pengutronix Kernel Team
> <kernel@xxxxxxxxxxxxxx>; Fabio Estevam <festevam@xxxxxxxxx>; Peng Fan
> <peng.fan@xxxxxxx>; devicetree@xxxxxxxxxxxxxxx; linux-
> remoteproc@xxxxxxxxxxxxxxx; imx@xxxxxxxxxxxxxxx; linux-arm-
> kernel@xxxxxxxxxxxxxxxxxxx; dl-linux-imx <linux-imx@xxxxxxx>
> Subject: [EXT] Re: [PATCH v9 4/5] gpio: rpmsg: add support for NXP legacy
> firmware protocol
> > +static struct rpmsg_gpio_fixed_up imx_fixed_up_data = {
> > + .recv_fixed_up = rpmsg_gpio_imx_recv_fixed_up,
> > + .send_fixed_up = rpmsg_gpio_imx_send_fixed_up, };
> > +
> > static int rpmsg_gpio_send_message(struct rpmsg_gpio_port *port,
> > struct rpmsg_gpio_packet *msg,
> > bool sync) @@ -572,6 +711,10 @@
> > static const struct of_device_id rpmsg_gpio_dt_ids[] = {
> >
> > static struct rpmsg_device_id rpmsg_gpio_channel_id_table[] = {
> > { .name = "rpmsg-io" },
> > + {
> > + .name = "rpmsg-io-channel",
> > + .driver_data = (kernel_ulong_t)(uintptr_t)&imx_fixed_up_data
> > + },
>
> Its not clear to me how this gets applied. Don't you need a different compatible?
> fsl,rpmsg-gpio-legacy or something?
>

This is not a compatible. It is the RPMSG channel name advertised by the remote processor.
The generic implementation uses "rpmsg-io" as the channel name, and "rpmsg-io-channel" is
used by NXP's existing firmware.

> I would also put it behind a CONFIG_ option, and in a different module. Nobody
> needs this code other than your legacy products. You don't need the bloat for
> your new devices and other vendors don't need it.
>

Other vendors may add fixed up handlers in the same way to support their existing products.

Thanks,
Shenwei

> Andrew