Monday, April 15, 2024

[fedora-arm] Re: Mapping GPIO Pins from Wandboard to Fedora/libpiod

Hi Derek,

> I have a Wandboard (yeah, I know, OLD Hardware) currently running a

As in the imx6 based Wandboard? Which model/rev? What release of
Fedora, what kernel etc?

> project, and I'm trying to add some GPIO inputs to it. In previous GPIO
> handling (on a different platform) I used the /sys/class/gpio interfaces
> to set up the GPIO, but I've discovered this is now deprecated and removed
> from Fedora. So I installed libgpiod and am trying to use it.

Yes, we stopped supporting that because it was deprecated and upstream
asked us to.

> I'm using
> https://download.technexion.com/development_resources/wandboard/wbquad-revb1-userguide.pdf
> as a reference for the board layout. Specifically, on page 27, it shows
> me that the JP4 header connects to GPIO3_12, GPIO3_27, GPIO6_31, CPIO1_24,
> GPIO7_8, GPIO3_26, GPIO_18, and GPIO_19.
>
> I figure that GPIO_18 is going to be gpiochip0 line 18, and GPIO3_12 will
> be gpiochip3 line 12.. Except that gpiodetect only tells me I have
> gpiochip0 through gpiochip6, so I'm not sure where GPIO7_8 would get
> mapped. That's the first issue I have.

You'd likely need to look at the device tree and pinmappings to see
how they're mapped out.

> The second issue is that the kernel does not have any named mappings, so
> running gpioinfo just displays generic data, like:
>
> gpiochip6 - 32 lines:
> line 0: unnamed unused input active-high
> line 1: unnamed unused input active-high
>
> Except, of course, looking at gpiochip3 line 12 shows me:
>
> gpiochip3 - 32 lines:
> ...
> line 12: unnamed "scl" output active-high [used open-drain]
>
> Which seems to imply that that GPIO3_12 is actually used for something
> else -- or my mapping strategy is off.

Probably a kernel device, often GPIOs are used for other things.

A quick look at the dtsi for the wandboards some of the GPIOs re used
for SCL/SDA pins on two of the i2c buses. The i2c1 seems to not have
anything attached so I guess in on a pin header for end user use, and
i2c12 has a audio codec and for the camera connector.

> I'd appreciate any guidance anyone might have on this subject.

If it's a iMX6 based Wandboard the guidance will be limted as the
support for ARMv7 went EOL when F-36 did so I have no recollection of
what kernel, libgpiod version etc was shipped there.

Peter
--
_______________________________________________
arm mailing list -- arm@lists.fedoraproject.org
To unsubscribe send an email to arm-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/arm@lists.fedoraproject.org
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue

No comments:

Post a Comment