cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Anonymous
Not applicable
3,618 Views

Problem with large physical memory mapping in LKM character device

Jump to solution

Hello,

 

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.

 

System information

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

 

Seth

0 Kudos
Reply
1 Solution

Accepted Solutions
Anonymous
Not applicable
4,311 Views

Figured it out.  Simple errors on my end. 

View solution in original post

0 Kudos
Reply
2 Replies
Xilinx Employee
Xilinx Employee
3,585 Views
Registered: ‎09-10-2008

Hi Seth,

 

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.

 

Sorry.

0 Kudos
Reply
Anonymous
Not applicable
4,312 Views

Figured it out.  Simple errors on my end. 

View solution in original post

0 Kudos
Reply