Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: RPI zero 2 w PL011 pinctrl states not observed by bcmgpio during boot



Thanks for the suggestions. I have been doing some additional testing
with the attach order and the FDT passes.

If I set bcmgpio to attach during pass 3, before plcom (pass 4), I
observe the following pinctrl set_config calls:

bcmgpio0: pinctrl set_config native phandle 0xa, internal handle 0x14b8
bcmgpio0: pinctrl set_config native phandle 0xb, internal handle 0x1454
bcmgpio0: pinctrl set_config native phandle 0x11, internal handle 0x15b4
bcmgpio0: pinctrl set_config native phandle 0xd, internal handle 0x1204
bcmgpio0: pinctrl set_config native phandle 0xe, internal handle 0xfa4
bcmgpio0: pinctrl set_config native phandle 0x12, internal handle 0xd10
bcmgpio0: pinctrl set_config native phandle 0x13, internal handle 0xf4c
bcmgpio0: pinctrl set_config native phandle 0x16, internal handle 0x107c

As you can see, now there are 0xa, 0xb and also 0x11 which I hadn't
noticed before.

I am still investigating and understanding the relationship between
the attach order, the FDT passes and the pinctrl configuration, but
thought these observations might be useful.

El lun, 30 nov 2026 a las 2:00, Yuri Honegger (<yurix%netbsd.org@localhost>) escribió:
>
>
>
> > Am 30.11.2026 um 04:38 schrieb Lloyd Parkes <lloyd%must-have-coffee.gen.nz@localhost>:
> >
> > Kia ora Maximo,
> > My FDT knowledge is a bit rusty, but I had a quick look at the source code and I think the pl011 driver assumes that the pinctrl has already been configured by U-Boot (or similar boot code) while some other drivers (such as I2C) do not make that assumption.
>
> on a simple-bus, pinctrl is automatically configured before the device attaches. See https://nxr.netbsd.org/xref/src/sys/dev/fdt/fdtbus.c#470
>
> >
> > The pl011 device is normally used for the serial console and so the pinctrl would be configured correctly very early in the boot process.
>
> This could be worth checking: Does the pinctrl device attach before the gpio? Can you share a dmesg?
>
> >
> > It really shouldn't be too hard to add a call to set_config in the plcom driver if the FDT contains a pinctrl configuration for the pl011 device. Maybe we could even add a flag to the device so that FDT pinctrl can be ignored if we find cases where it is a problem.
>
> See above for the preferred solution.
>
> >
> > It might also be possible to convince U-Boot to configure the pinctrl correctly.
> >
> > This all presupposes that the pl011 pinctrl configuration that the RPI is actually running with is wrong and needs to be correctly configured.
> >
>
> - yuri
>


Home | Main Index | Thread Index | Old Index