Re: [PATCH v6 4/5] pinctrl: freescale: add the Layerscape RCW pad-mux driver
From: Vincent Jardin
Date: Tue Nov 17 2026 - 11:44:32 EST
Hi Vladimir,
> The "i2c" and "gpio" functions of lx2160a_sdhc2_data74_funcs[] here
> hides some real unpleasantness. These 4 pins either get all assigned to
> I2C7_SCL, I2C7_SDA, I2C8_SCL, I2C8_SDA, or they get all assigned to GPIO.
> But they cannot be assigned in pairs of two (or individually, i.o.w. not
> in the granularity we need), which makes independent I2C bus recovery
> practically impossible (i2c6 as I2C while i2c7 is as GPIO).
yep, the doc is clear about it: SDHC2_DAT74_PMUX is a single field for
the 4 pads, 0b001 gives GPIO_2[18:15] and 0b010 gives IIC7 and IIC8
together (RM rev 1, 4.9.8.9). IIC7 and IIC8 are not available on any
other pad.
Checking from other angles, the A-010650 workaround uses one write for both
buses: 0x700100130 = RegA OR 0x031. That mask looks wrong to me though: bits 5:4
belong to SDHC2_BASE_PMUX, and OR-ing 0x001 onto 0b010 gives the reserved
0b011. Could someone at NXP have a look ?
> The way the code is currently written, the pin_request() call will fail here:
Yes, in fact, it is not new with this series: both nodes have shared the
same setting since
8a1365c7bbc1 ("arm64: dts: lx2160a: add pinmux and i2c gpio to support bus recovery")
from Carlos Song (NXP) where the two pinctrl-single states covered the same
bits, so the second controller would have failed the same way. Wihtin the
kernel, there is no board that enables i2c6 or i2c7, so nobody did hit it!
> Due to the fundamental issue of this limitation, I don't think it makes
> sense to have the pinctrl states described in fsl-lx216x.dtsi for i2c6
> and i2c7. Perhaps you could remove them in another change (either as a
> follow-up, or another patch in v7 if you need to resend).
Done for v7 as an additional patch: the DTS drops pinctrl-names, pinctrl-0/1
and scl/sda-gpios from i2c6 and i2c7, and the two states nothing else uses.
A board that needs one of these buses can add its own states, or set the
field once with a hog on the pad-mux node.
I tested on my board for regressions, since there those 4 pads carry
the eMMC DAT[7:4]: the other I2C buses still set up their GPIO recovery,
and the eMMC still runs in 8-bit HS400.
I also went through the other fields. 7 more settings mix two
controllers the same way:
- flextimer on iic2, irq3-0, irq7-4, evt4-3 and evt2-0 (FTM1 and FTM2 channels)
- sdhc-spi on sdhc1-base (SDHC1 with SPI3_PCS0) and usb on usb-ext (USB1 and USB2)
No dts claims any of them.
About your previous comment on clk-out: v7 names encoding 0 "clk-out".
On my board, with debugfs, it shows now:
pin 20 (evt2-0) 0:? evt
pin 21 (clk-out) 0:? clk-out
pin 22 (asleep) 0:? asleep
and the U-Boot port of this driver shows "clk-out : clk-out" in
"pinmux status".
My take: the reserved marking comes from RM rev 1: its revision history
says "Updated 0b000 as reserved" and the CLK_OUT configuration section was
removed, while table 19 still lists 000 (CLK_OUT).
There is a similar gap on EC1: the signal tables list CLK_OUT2 on
EC1_TXD0/GPIO4_DAT03, but EC1_PMUX only has 0b00 RGMII and 0b01 GPIO,
0b10 and 0b11 being reserved. Would you know which value selects CLK_OUT2 ?
thank you,
Vincent