07-07-2010 08:18 AM
I am having some problems with mapped physical IO address in a Linux kernel module for a character device. I am attempting to map a large area (256MB+) of physical IO space of a memory device that is not the system RAM. I first call request_mem_region with the base physical address, size and iomem name. Then, I call ioremap with the same physical address and size values. Both calls are successful. I then use the memcpy_fromio and memcpy_toio functions in my device read and write functions. I am using dd to test functionality of the driver. The driver read works perfectly up to 640 KB. If I try to read more than 640 KB of data (160 pages) I recieve a Bus Error and dmesg states that I have had a "PLB Data Read Error." I have also implemented llseek which also works for any combination of a seek with a data read that is less than 640 KB. However, if i seek to an offset close to 640 KB (but less than) and perform a read that will surpass the 640 KB region, the system locks up.
Virtex5 FX100T - 256 MB RAM - Linux 2.6.33 (PowerPC 440)
I have a few questions:
1. First, any insight to my problem?
2. What are the details of realationship between request_mem_region and ioremap?
3. Does ioremap have limitations in a LMK?
Thanks in advance for the help
07-09-2010 07:16 AM
I haven't done much in that area so I don't have much insight.
Might be worth moving this out to a non-Xilinx Linux forum also.