kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Userspace access to PCIe - SATA device memory BAR
@ 2013-03-21 16:36 John Beard
  0 siblings, 0 replies; only message in thread
From: John Beard @ 2013-03-21 16:36 UTC (permalink / raw)
  To: kernelnewbies

Hi,

I have a PCIe - SATA bridge device, and I would like to access the
I2C control registers in the PCI memory region (BAR5) - these use
just two addresses in the BAR. I have tried, in userspace, to mmap()
the /sys/bus/pci/devices/..../resource5 file and read from that, but
all I get is 0xFF in every byte.

I used pcimem (https://github.com/billfarrow/pcimem.git) to try to
read the BAR.

The device is already matched by the 'ahci' driver, and the attached
disks are visible and mountable. If I unbind the ahci driver to use
uio, I can of course no longer use the device as a SATA bridge.

In other PCI devices which are also matched by ahci, I can mmap and
read published BARs fine without unbinding the ahci driver.

What is the correct way to fiddle with the memory in the BARs of a
PCI device, while still letting the normal driver run the device?
I am not doing anything related to AHCI or SATA, just reading and
writing to the "side-channel" communication hardware.

Best regards,

John

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-03-21 16:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-21 16:36 Userspace access to PCIe - SATA device memory BAR John Beard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).