Discussion:
Raspberry Pi: gpiomem device support
(too old to reply)
Thomas Lehmann
2024-04-06 07:50:48 UTC
Permalink
I forgot to include the references:

[1]: https://raspi.debian.net/tested-images/
[2]: https://github.com/raspberrypi/linux/issues/2514

Ah, and I found Kernel code in drivers/char/raspberrypi-gpiomem.c and
the accompanying Kconfig defining the config "RASPBERRYPI_GPIOMEM".

That .c file sounds like the something called "raspberrypi-gpiomem".
This config is currently not defined in the installed Kernel's config
(it's default is "n").
So, one would obviously enable RASPBERRYPI_GPIOMEM (default: "n") in the
kernel config instead.

If someone can point me to the correct repository I'm happy to provide a
pull request or patch.
Pointing me to a cross compile and/or testing guide of ARM Linux kernels
would be helpful.

Thank you for taking time looking into this.


Best regards,
Thomas.
gene heskett
2024-04-06 07:51:20 UTC
Permalink
I'm not sure if this will help. I explored GPIO on Debian a bit and
posted my code at https://github.com/HankB/GPIOD_Debian_Raspberry_Pi
<https://github.com/HankB/GPIOD_Debian_Raspberry_Pi>
I have NDI if its usable for you, but linuxcnc for the pi's has a driver
module intended for the mesa 7i90HD & similar interface boards, which
can be configured for high speed spi interfacing that talks spi over 3
gpio pins, talking to the 7i90HD in 32 bit packets at 42+ megabaud, and
gets 32 bit status packets back from the 7i90HD card at 25 megabaud.
Been rock solid thru rpi3b/rpi4b's to run by late WW-II vintage 11x54 I
converted to lcnc nearly a decade back just to see if I could do it,
teaching my old lathe all the new dances that come with linuxcnc. The
limits of what it can do today is limited only by your imagination.
best,
On Wed, Apr 3, 2024 at 12:42 AM Thomas Lehmann
Good Day!
I've tried to get GPIO access working on 1B (Raspberry Pi B+) images
from [1], however, the "/dev/gpiomem" device is missing and access to
"/dev/mem" (some libaries fall back to that device) is denied (even as
root, and I don't even want to use "/dev/mem").
Searching the internet brough up some udev rules. So I tried thse
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
KERNEL=="gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", KERNEL=="gpiomem", GROUP="gpio",
MODE="0660"
I later found /lib/udev/rules.d/60-rpi.gpio-common.rules and added
these
rules. Also no success.
I can't find "gpiomem" in the kernel config.
In the official Raspberry Pi repository there once was a request [2] to
enable a kernel config "CONFIG_BCM2835_DEVGPIOMEM". This module was
apparently replaced by something called "raspberrypi-gpiomem" in commit
27543eeff4553f5caf7c6d8763c566042b047af0. Interestingly I can't find
that phrase in any other commit in their repo.
(Note: I'm aware that Debian does not refer to the Raspberry Pi [2]
repo, this just came up in my research.)
To me there seems to be kernel support missing or a config is not set.
Can someone please clarify on this?
Thank you.
Best regards,
Thomas.
--
Beautiful Sunny Winfield
Cheers, Gene Heskett, CET.
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Uwe Kleine-König
2024-04-06 07:51:46 UTC
Permalink
Hello Thomas,
Post by Thomas Lehmann
[1]: https://raspi.debian.net/tested-images/
[2]: https://github.com/raspberrypi/linux/issues/2514
Ah, and I found Kernel code in drivers/char/raspberrypi-gpiomem.c and
the accompanying Kconfig defining the config "RASPBERRYPI_GPIOMEM".
I didn't look up what a gpiomem device does. I guess it drives GPIOs
from userspace? I suggest evaluating gpiochip devices. The obvious lib
to use is libgpiod2.

If that reply doesn't match your plan: What do you want to achieve?

Best regards
Uwe
Diederik de Haas
2024-04-06 07:52:34 UTC
Permalink
Post by Thomas Lehmann
Ah, and I found Kernel code in drivers/char/raspberrypi-gpiomem.c and
the accompanying Kconfig defining the config "RASPBERRYPI_GPIOMEM".
That file and that module/symbol do NOT exist in the upstream Linux kernel
(probably only in the RaspberryPi kernel) and therefor can't be enabled in the
Debian kernel.
Hank Barta
2024-04-06 07:52:40 UTC
Permalink
I'm not sure if this will help. I explored GPIO on Debian a bit and posted
my code at https://github.com/HankB/GPIOD_Debian_Raspberry_Pi

best,
Good Day!
I've tried to get GPIO access working on 1B (Raspberry Pi B+) images
from [1], however, the "/dev/gpiomem" device is missing and access to
"/dev/mem" (some libaries fall back to that device) is denied (even as
root, and I don't even want to use "/dev/mem").
Searching the internet brough up some udev rules. So I tried thse
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
KERNEL=="gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", KERNEL=="gpiomem", GROUP="gpio",
MODE="0660"
I later found /lib/udev/rules.d/60-rpi.gpio-common.rules and added these
rules. Also no success.
I can't find "gpiomem" in the kernel config.
In the official Raspberry Pi repository there once was a request [2] to
enable a kernel config "CONFIG_BCM2835_DEVGPIOMEM". This module was
apparently replaced by something called "raspberrypi-gpiomem" in commit
27543eeff4553f5caf7c6d8763c566042b047af0. Interestingly I can't find
that phrase in any other commit in their repo.
(Note: I'm aware that Debian does not refer to the Raspberry Pi [2]
repo, this just came up in my research.)
To me there seems to be kernel support missing or a config is not set.
Can someone please clarify on this?
Thank you.
Best regards,
Thomas.
--
Beautiful Sunny Winfield
Loading...