[PATCH v5 0/5] lx2160a: change the pad muxes through the RCW override

From: Vincent Jardin via B4 Relay

Date: Sun Nov 15 2026 - 06:06:06 EST


The LX2160A muxes its IIC, XSPI, SDHC, UART, IRQ and EVT pads from
fields of the RCW. They are read-only in RCWSR12..14 of DCFG, and are
changed at runtime through the override registers in the DCSR view of
DCFG, which read 0 until written.

Since commit 8a1365c7bbc1 ("arm64: dts: lx2160a: add pinmux and i2c
gpio to support bus recovery"), fsl-lx216x.dtsi drives the override
registers with pinctrl-single for the I2C bus recovery. 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.

This series reads the fields in effect from RCWSR and writes RCWCR, as
fsl_guts_rcw_rmw() already does for the SerDes protocols:

- patches 1 and 2 describe the pad mux as a child of the DCFG node,
which gains its DCSR view
- patch 3 exports the RCW override of fsl-guts for the pad-mux fields
only
- patch 4 adds the pinctrl driver: one group per RCW field, one
function per encoding
- patch 5 moves the pad muxes of fsl-lx216x.dtsi under DCFG. Labels
and pin node names stay, so no board file changes, and the
pinctrl-single node goes

Patch 4 uses the exports of patch 3, so it cannot be applied alone:
patches 1 to 4 could be for the the pinctrl tree with an Ack of
the soc/fsl maintainer on patch 3,
and patch 5 through the i.MX tree once the driver is in,
since the I2C pin states of fsl-lx216x.dtsi then belong to it.

DTBs built before patch 5 keep their pinctrl-single node and behave as
before. There is no Fixes: tag, since patch 5 depends on a new driver.
I did not believe it should be backported then.

Tested on a Nodebox v3 (LX2160A) whose RCW muxes XSPI1_A_DATA[7:4],
SDHC1 and IIC5 are not set with the defaults, so I could confirm:
- with pinctrl-single the first I2C probe cleared those fields
- with this series RCWSR12..14 read after boot exactly what the RCW and
the board's pin states select
- all I2C controllers come up with their recovery states and a
forced bus recovery on IIC1 (multi-master enabled for the test)
changes only that field

Thanks to Vladimir Oltean for pointing at fsl_guts_rcw_rmw() when I
tried to prime the override registers from the RCW instead:
https://github.com/nxp-qoriq/rcw/pull/8

Signed-off-by: Vincent Jardin <vjardin@xxxxxxx>
---
Changes in v5:
- soc: fsl: guts: the exports become fsl_guts_pmux_read(),
fsl_guts_pmux_override() and fsl_guts_pmux_override_supported(). guts
lists the pad-mux fields of the LX2160A and refuses any other field
or register, so the serdes fields cannot be changed (Vladimir Oltean)
- dt-bindings, pinctrl, dts: add the EC1, EC2, USB_EXT, GTX_CLK and
SDHC1_DS pad muxes of RCWSR27, the second reg of the node (Vladimir Oltean)
- Patch 3 is reworked: drop the review tags, new round of review is
needed (TBC, from Christophe Leroy and Frank Li)
- Patch 1 gets a reg, 5 groups and 4 functions:
same drop the the Reviewed-by of Rob Herring and Frank Li
- Patch 2: its description names RCWSR27 too, I assume the
Reviewed-by of Rob Herring can remain
- Link to v4: https://lore.kernel.org/r/20261114-for-upstream-lx2160a-rcw-pinmux-v1-v4-0-eefcea066a55@xxxxxxx

Changes in v4:
- pinctrl: MAINTAINERS with imx@xxxxxxxxxxxxxxx
FUNC and GROUP macros with LX2160A_PMUX_ prefix (Frank Li)
- Add the Reviewed and Ack tags of Rob Herring and Frank Li
- Patches 1, 2, 3 and 5 are not changed
- Link to v3: https://lore.kernel.org/r/20261108-for-upstream-lx2160a-rcw-pinmux-v1-v3-0-5a0063f1da9e@xxxxxxx

Changes in v3:
- dt-bindings, dts: the pad-mux child is bus-addressed like the
clock-controller child of the LS1028A dcfg: its reg is the RCWSR12
to RCWSR14 window, under #address-cells, #size-cells and ranges on
the dcfg node, the override registers stay the DCSR view of the
parent (Krzysztof Kozlowski)
- cover letter: patch 4 cannot be applied without patch 3 (Linus Walleij)
- Patches 3 and 4 are unchanged
- Link to v2: https://lore.kernel.org/r/20261103-for-upstream-lx2160a-rcw-pinmux-v1-v2-0-3aad0860b984@xxxxxxx

Changes in v2:
- dt-bindings: list, for each function, the groups, so the
schema refuses the associations the driver refuses (Frank Li)
- Patches 2 to 5 are unchanged
- Link to v1: https://lore.kernel.org/r/20261103-for-upstream-lx2160a-rcw-pinmux-v1-v1-0-0a61a9837744@xxxxxxx

---
Vincent Jardin (5):
dt-bindings: pinctrl: add the NXP LX2160A RCW pad mux
dt-bindings: soc: fsl: layerscape-dcfg: add the LX2160A pad-mux child
soc: fsl: guts: add the RCW override of the pad muxes
pinctrl: freescale: add the LX2160A RCW pad-mux driver
arm64: dts: lx2160a: describe the pad muxes as the DCFG RCW override

.../bindings/pinctrl/fsl,lx2160a-rcw-pinmux.yaml | 309 ++++++++++++++++
.../bindings/soc/fsl/fsl,layerscape-dcfg.yaml | 18 +
MAINTAINERS | 8 +
arch/arm64/boot/dts/freescale/fsl-lx216x.dtsi | 377 ++++++++++---------
drivers/pinctrl/freescale/Kconfig | 15 +
drivers/pinctrl/freescale/Makefile | 1 +
drivers/pinctrl/freescale/pinctrl-lx2160a.c | 401 +++++++++++++++++++++
drivers/soc/fsl/guts.c | 122 ++++++-
include/linux/fsl/guts.h | 3 +
9 files changed, 1078 insertions(+), 176 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261103-for-upstream-lx2160a-rcw-pinmux-v1-31f9ad97dc86

Best regards,
--
Vincent Jardin <vjardin@xxxxxxx>