Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-30-2008, 01:14 PM
|
#1
|
LQ Newbie
Registered: Feb 2008
Location: San Diego, CA
Posts: 15
Rep:
|
memcpy_toio transfers data in 4 byte chunks, but I need to transfer data in one lump.
I am writing a PCIe device driver that requires me to write data to the address referenced by a Base Address Register (BAR). This particular BAR is setup to be in a memory configuration (as opposed to I/O). I've checked the flags (pci_resource_flags) and confirmed that the address space is I/O Resource Memory. I need to transfer data ranging from a couple bytes to 1/3 of a kilo byte, to this space. My code does the following:
1) calls pci_iomap(), specifying the size requested by using pci_resource_len() //for setup
2) calls memcpy_tio() //for actual transfer
The data is going to and being recieved by the proper location, but the problem is that the data is being split into 4 byte packets (instead of one lump). I used a Lecroy PCIe analyzer, which showed that the data I am transferring is being split into TLPs with 4 byte payloads (this confirms the behavior). It was mentioned to me that I/O, in general, is transfered in 4 byte packets. Is there some way to have it send all the data I want to transfer in one TLP (one lump)?
Computer Info:
1) SUSE Linux Enterprise Server 10 SP1 (kernel version 2.6.16)
2) x86_64 (8 core) processor
3) Dell Precision 490
Any suggestions of how to fix this or places to look to to research this would be more than appreciated. Thank you for taking the time to read my post.
|
|
|
05-30-2008, 07:08 PM
|
#2
|
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873
|
In a 64 bit processor 4 bytes = 1 word. At the lowest level the computer can only move data one word at a time, AFAIK.
|
|
|
06-02-2008, 11:25 AM
|
#3
|
LQ Newbie
Registered: Feb 2008
Location: San Diego, CA
Posts: 15
Original Poster
Rep:
|
Thanks for responding.  Yes, 4bytes for a transfer rate makes sense to a space at a time. I am more concerned about the TLPs (Transaction Layer Packets). I believe the bus_driver is responsible for creating those TLPs, which are sent off to the Root Complex for the PCIe system. At some point, which I'm not aware of how it does it, the bus_driver decides how much data should be put into a single TLP. That TLP can have numerous different sizes, beyond 4 bytes. I need to be able to create a TLP of size 1/3 KB. I believe that this will require me to re-write the bus_driver and recompile my kernel. 
|
|
|
All times are GMT -5. The time now is 05:09 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|