So, my problem is that I cannot read or write to prefetchable memories that are opened to me for pcie. I have two different setups:
1 - I have a linux kernel 4.9 root complex device, and also a 4.9 device as endpoint. I'm able to do addressing of that device, so I should be able to read from or write to it. But somehow I'm reading gibberish only.
2 - I have the same root complex device and a baremetal device as endpoint. I'm also able to address the device's BARs, but when I write on it, it denies the writes (I can see the memory on a JTAG debugger) and also when I read it it returns 0xFFFF for a word(By the way, the memory was different than 0xFFFF).
I have researched the pre-fetchable memories on pci, but found only these:
- A pci switch may perform write operations to an endpoint device by byte-merging (Merging bytes into a word.). Since I'm writing a word, the problem shouldn't be related to that.
- Reading from prefetchable memory cannot cause side-effects. (This seems to be not an issue starter.)
Thanks for your time, I'm happy to clarify my setup or cases if need be.
I have a little more progress that I'd like to pass to you guys: A bare-metal root-complex can access another root-complex's memory even if it is prefetchable. So, the usual suspect seems to be the kernel's default drivers.