Re: Raspberry Pi 3B: /dev/mem mmap GPIO works on earmv7hf but not onaarch64
Yuri Honegger <[email protected]> Wed, 18 Feb 2026 22:43:57 +0100
| Newsgroups | gmane.os.netbsd.ports.arm |
|---|---|
| Message-ID | <[email protected]> |
> > What's wrong with gpioctl(8)? > > In my use case I am not only toggling a single GPIO bit but need to > update 8-bit bus data / 2-bit control signals atomically for the > PSG accesses (unlike FreeBSD we don't provide GPIOACCESS32 ioctl). > > I also need to program BCM283x GPCLK0 (clock manager registers) > as the PSG master 2MHz clock, and I have not found a stable API > for that on NetBSD/evbarm (please correct me if I missed one). > > That tends to push userland implementations toward MMIO register access. > > So the main question is: is the intended answer > (A) "/dev/mem is RAM-only for aarch64; peripheral MMIO via /dev/mem > is unsupported", or > (B) "peripheral MMIO via /dev/mem is acceptable if correct device > attributes are implemented"? Driving a 8-bit bus at 2MHz will be hard with any abstraction between your software and the GPIOs, even with a GPIOACCESS32 (unless you only need to write new values at a much much lower rate than 2MHz) In my opinion, the cleanest way would be to write a kernel module specifically for this application so you can mmio as you like. You might want to deactivate the other gpio driver in your config/dtb though. - yuri