0

I have a problem finding the correct path to use for open and then mmap. In another linux system I found the device at "/sys/bus/pci/devices/0000:01:00.0/resource0" but what should the path be for the raspberry CM4? I have checked that the device is linked by lspci but are there any easy way to locate the correct path to use?

1 Answers1

1

It is the same?

In my experience the path should be the same up to /sys/bus/pci/devices/. Then its the id that lspci tells you. So I dont know where this would be going wrong.

Identifying a device

I might misunderstand your question. If you need an easy way to identify a device then one thing you can do is iterate over all folders in devices, and then reading something that can identify your device like "device" and "vendor". (basically this)

Though there are probably better ways of doing this.

Enabling mmapped interfacing

On a sidenode, on Raspbian you might need to enable memory mapped interfacing using setpci -s <BUS_ADDR> COMMAND=0x02

r123
  • 11
  • 2