Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: vjardin@free.fr
Cc: Dong Aisheng <aisheng.dong@nxp.com>,
	 Fabio Estevam <festevam@gmail.com>, Frank Li <Frank.Li@nxp.com>,
	Jacky Bai <ping.bai@nxp.com>,
	 Pengutronix Kernel Team <kernel@pengutronix.de>,
	NXP S32 Linux Team <s32@nxp.com>,
	 Linus Walleij <linusw@kernel.org>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	 Sascha Hauer <s.hauer@pengutronix.de>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	 linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
	Ioana Ciornei <ioana.ciornei@nxp.com>
Subject: Re: [PATCH v4 4/5] pinctrl: freescale: add the LX2160A RCW pad-mux driver
Date: Sun, 15 Nov 2026 11:05:35 +0200	[thread overview]
Message-ID: <avjaK3cOj3iQ6G6w@skbuf> (raw)
In-Reply-To: <20261114-for-upstream-lx2160a-rcw-pinmux-v1-v4-4-eefcea066a55@free.fr> <20261114-for-upstream-lx2160a-rcw-pinmux-v1-v4-4-eefcea066a55@free.fr>

On Sat, Nov 14, 2026 at 10:12:31AM +0100, Vincent Jardin via B4 Relay wrote:
> From: Vincent Jardin <vjardin@free.fr>
> 
> The LX2160A muxes its IIC, XSPI, SDHC, UART, IRQ and EVT pads from
> fields of the RCW, read-only in RCWSR12..14 of DCFG and changed at
> runtime through the same fields of the override registers in its DCSR
> view, which read 0 until written.
> 
> Since commit 8a1365c7bbc1 ("arm64: dts: lx2160a: add pinmux and i2c
> gpio to support bus recovery") Linux drives them with pinctrl-single on
> the override registers, so its first pin state clears every other field
> of the word: a board whose RCW programs a non-zero pad mux loses those
> pads at the first I2C probe.
> 
> Add a driver for the pad mux as a child of the DCFG node: the fields
> of RCWSR12..14 and their encoding.
> Then pin states select them with the generic function and groups
> properties, and every change goes through the RCW override
> of fsl-guts, which reads the status register, writes the override and
> waits for the status register to follow.
> 
> Signed-off-by: Vincent Jardin <vjardin@free.fr>
> ---
>  MAINTAINERS                                 |   8 +
>  drivers/pinctrl/freescale/Kconfig           |  15 ++
>  drivers/pinctrl/freescale/Makefile          |   1 +
>  drivers/pinctrl/freescale/pinctrl-lx2160a.c | 368 ++++++++++++++++++++++++++++
>  4 files changed, 392 insertions(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 93abbb315065..106a0cc7f25c 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -20207,6 +20207,14 @@ F:	Documentation/devicetree/bindings/clock/*imx*
>  F:	drivers/clk/imx/
>  F:	include/dt-bindings/clock/*imx*
>  
> +NXP LX2160A RCW PAD-MUX DRIVER
> +M:	Vincent Jardin <vjardin@free.fr>
> +L:	linux-gpio@vger.kernel.org
> +L:	imx@lists.linux.dev
> +S:	Maintained
> +F:	Documentation/devicetree/bindings/pinctrl/fsl,lx2160a-rcw-pinmux.yaml
> +F:	drivers/pinctrl/freescale/pinctrl-lx2160a.c
> +
>  NXP NETC ETHERNET SWITCH DRIVER
>  M:	Wei Fang <wei.fang@nxp.com>
>  R:	Clark Wang <xiaoning.wang@nxp.com>
> diff --git a/drivers/pinctrl/freescale/Kconfig b/drivers/pinctrl/freescale/Kconfig
> index fd53cf5bb843..a3222714c970 100644
> --- a/drivers/pinctrl/freescale/Kconfig
> +++ b/drivers/pinctrl/freescale/Kconfig
> @@ -283,3 +283,18 @@ config PINCTRL_IMXRT1170
>  	select PINCTRL_IMX
>  	help
>  	  Say Y here to enable the imxrt1170 pinctrl driver
> +
> +config PINCTRL_LX2160A
> +	bool "NXP LX2160A RCW pad-mux driver"
> +	depends on OF
> +	depends on ARCH_LAYERSCAPE || COMPILE_TEST
> +	default ARCH_LAYERSCAPE
> +	select FSL_GUTS
> +	select GENERIC_PINCTRL_GROUPS
> +	select GENERIC_PINMUX_FUNCTIONS
> +	select GENERIC_PINCONF
> +	help
> +	  Say Y here to mux the IIC, XSPI, SDHC, UART, IRQ and EVT pads of the
> +	  LX2160A at runtime. The pads are muxed by fields of the RCW:
> +	  the driver changes it in the DCSR view of the DCFG that fsl-guts
> +	  drives, and is what the I2C bus recovery of the LX2160A needs.

I'm sorry if this was discussed before, but did you consider targeting a
wider range of Layerscape SoCs with this driver? It's pretty generic
apart from the pinmux functions and groups, which are all data, not code.

For example LS1028A, which is part of the same chassis 3.2 as LX2160A,
has a pretty similar pinmux group layout (subset of LX2160A except for
SoC-specific pinmuxing in RCWSR27). The functions are a superset of
LX2160A though (for example IIC3_PMUX and IIC4_PMUX can also take the
values of 3 and 4).

The older chassis have a dissimilar layout to LX2160A/LS1028A, but
similar among themselves (they have a two-level I2C_EXT + I2C_BASE
system), and their core mechanism remains through the same RCW override
API.

I'm not saying to add driver support for those other platforms, but to
have them in mind and to leave some space so that they could be added to
the same driver without having to rename it and most of the code.

  reply	other threads:[~2026-11-15  9:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14  9:12 [PATCH v4 0/5] lx2160a: change the pad muxes through the RCW override Vincent Jardin via B4 Relay
2026-11-14  9:12 ` [PATCH v4 1/5] dt-bindings: pinctrl: add the NXP LX2160A RCW pad mux Vincent Jardin via B4 Relay
2026-11-14  9:12 ` [PATCH v4 2/5] dt-bindings: soc: fsl: layerscape-dcfg: add the LX2160A pad-mux child Vincent Jardin via B4 Relay
2026-11-14  9:12 ` [PATCH v4 3/5] soc: fsl: guts: add the RCW override of any RCWSR Vincent Jardin via B4 Relay
2026-11-14  9:57   ` Christophe Leroy (CS GROUP)
2026-11-14 10:06     ` Vincent Jardin
2026-11-14 21:47   ` Vladimir Oltean
2026-11-14 23:47     ` Vincent Jardin
2026-11-15 11:18       ` Vincent Jardin
2026-11-14  9:12 ` [PATCH v4 4/5] pinctrl: freescale: add the LX2160A RCW pad-mux driver Vincent Jardin via B4 Relay
2026-11-15  9:05   ` Vladimir Oltean [this message]
2026-11-14  9:12 ` [PATCH v4 5/5] arm64: dts: lx2160a: describe the pad muxes as the DCFG RCW override Vincent Jardin via B4 Relay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=avjaK3cOj3iQ6G6w@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=Frank.Li@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=chleroy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=ioana.ciornei@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=ping.bai@nxp.com \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=s32@nxp.com \
    --cc=shawnguo@kernel.org \
    --cc=vjardin@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox