mt7621 GPIO mapping mystery

Sergio Paracuellos sergio.paracuellos at gmail.com
Sat Jan 21 05:00:54 PST 2023


Hi,

On Sat, Jan 21, 2023 at 1:19 PM Lukas Zeller <luz at plan44.ch> wrote:
>
> Hi,
>
> > On 21 Jan 2023, at 08:56, Sergio Paracuellos <sergio.paracuellos at gmail.com> wrote:
> >
> > [...] Yes, you have to claim the pin group as gpio on the device tree to
> > make this work.
>
> This revals a underlying problem I tried to ask about back in June 2022 [1] - what is the state of userland GPIO support in OpenWrt?
>
> Changing the DT is *not* something an user of an educational/experimental device based on OpenWrt is able to do, as long as the DT is baked into the firmware image, and not modifiable from user space.
>
> Allowing configfs loadable device tree overlays would make that possible, but that path was decided against (so far) [2].
>
> So while I understand that using only the DT mechanisms for configuring GPIO modes, named gpios and libgpiod instead of /sys/class/gpio etc. is the way to go, I must also state that without loadable DT overlays, this essentially makes openwrt unsuitable for experimental/educational devices.

Configure the GPIO modes is not something that is expected to be done
by a user since all of that belongs to the pinctrl driver space and
AFAIK linux kernel people are not thinking in doing pinctrl driver
user-space tools. The libgpiod is useful to detect and set to on and
off different pins (among other pure GPIO operations) but from the
already function GPIO set up in them. I am not doing the rules, I am
just saying the things that are now in the kernel and user space as I
think they are. As I have already said, I am not an expert in this
topic at all but maybe if we want to do such complex things like
configuring the mode of a pin from user space some kind of user space
drivers need to be provided in some way... So, if openWRT is using
linux kernel, at the end they have to also live with kernel people's
decisions in some way...

>
> I could also understand if this was an intentional decision, after all OpenWrt is a router OS.
>
> But *is* it intentional? I find OpenWrt highly useful as a base OS for small networked devices that are not routers, to cover the mostly empty space between Arduino and RaspberryPi. Useful Linux in 16M flash rather than 32GB, with no flash wear problems by design...
>
> [1] http://lists.openwrt.org/pipermail/openwrt-devel/2022-June/038912.html
> [2] http://lists.openwrt.org/pipermail/openwrt-devel/2021-November/037139.html
>
> Lukas

Best regards,
    Sergio Paracuellos



More information about the openwrt-devel mailing list