PCIe Memory space access

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PCIe Memory space access

1,191 Views
mohsenhaghighat
Contributor III

Hi

I'm using PCIe port on MPC8308 and I have some problems when trying to use it. The endpoint PCIe device has memory space equal to 256MB. I can easily read and write configuration space of the endpoint device by using "pciutils" package of linux kernel. After writing correct values in configuration registers and getting the permission to access the memory space; I tried to access memory space by using "mmap" function in C and I used file descriptor located at " /sys/devices/pci0000\:00/0000\:00\:00.0/resource0" which was exactly 256MB (equal to memory space of endpoint device) so it seems that I am using correct path for file descriptor. but unfortunately when I try to use (write and read) memory space by using returned address of "mmap" function; I cannot read the read-only registers of endpoint device correctly. Also, when I read addresses bigger than 0x7FFFFFC, the MPC8308 is rebooted.

Considering above situation, can you help us to read memory-space (because we correctly read configuration space by "pciutils" package)? Do I miss any step to initialize the PCI interface? Do I should change anything in the kernel image? Do you have any example code that can help us?

thanks

0 Kudos
1 Reply

519 Views
ufedor
NXP Employee
NXP Employee

It is reasonable to investigate complicated issues as Technical Cases:

https://community.freescale.com/thread/381898

0 Kudos