Terminus-IMRC / libvc4regmap

A library for accessing peripherals on Raspberry Pi
Other
0 stars 0 forks source link

mmap fails on STRICT_DEVMEM=y kernel #12

Open Terminus-IMRC opened 6 years ago

Terminus-IMRC commented 6 years ago

Current implementation mmap's entire peripheral memory, while CONFIG_STRICT_DEVMEM=y kernel refuses memory mapping of which area is already used by drivers. So such mapping fails with EPERM on most cases.

So what should we do? Map peripheral on demand? How?

Terminus-IMRC commented 6 years ago

We can use /dev/vc-mem instead of /dev/mem!!! -- though it's not merged into stable yet...: https://github.com/torvalds/linux/blob/master/drivers/staging/vc04_services/interface/vchi/TODO#L6

Terminus-IMRC commented 6 years ago

So we should at first try /dev/vc-mem to access peripheral on standard Raspbian but STRICT_DEVMEM=y kernel, and then try /dev/mem.