On Thu, Jul 27, 2023 at 11:10:36PM +0100, andy pugh wrote: > On Thu, 27 Jul 2023 at 22:55, Kent Gibson <warthog618@xxxxxxxxx> wrote: > > > On a Pi is it significantly faster to go direct to hardware using > > /dev/gpiomem, rather than going via the kernel as libgpiod does. > > I do my best to avoid using gpiomem these days, but if you really need to > > minimize CPU cycles or latency then that is another option. > > The existing driver uses gpiomem, but the interface used seems to not > be set up in Debian Bookworm. > It might be available in _Raspbian_ but that current Raspbian version > is based on Bullseye (or Buster) > gpiomem is a Pi specific extension, and is not part of the mainline kernel. Not sure what kernel your Debian Bookworm is providing, but if it lacks the Pi extensions then you wont get gpiomem. > https://github.com/LinuxCNC/linuxcnc/issues/2371 > > Is where the suggestion was made to try gpiod, initially because of a > problem with the way we were detecting Pi versions, but then because > gpiomem wasn't there. > Yeah, the Pi4 requires a change to the driver as they changed the GPIO register map, IIRC. > (It can probably be configured, but we have a user base largely made > of machinists, not Linux enthusiasts) > The only way to disable gpiomem that I am aware of is to build the kernel without it, so either a mainline kernel, or a Pi kernel without BCM2835_DEVGPIOMEM set. Even if there is some way to disable it in config, it seems unlikely to me that they would compile it in, but then configure it out. Cheers, Kent.