Google
  Web www.spinics.net

Driver: accessing peripheral on main bus - iowrite32(), memcpy_toio()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hello all,

I am developing a driver for my own board based on an AT91rm9200. An FPGA is
attached to the ARM with the static memory controller. I need to write a big
amount (260kbytes) of data inside the fpga. I have some question about the
way to access the fpga (like a memory) from my driver.

Currently I am using the following function in the following order and it
works nice:
- request_mem_region(...)
- ioremap(...)
- iowrite32(...) //using the address returned by ioremap
- wmb()

But I am a little bit confused about using all those function. When I look
inside the mach independent code I don't see iowrite or wmb but only simple
pointer accessing the hardware. 

What is exactly the goal of iowrite, wmb and memcpy_toio function family in
comparison with the direct pointer writing? 

For writing a block of data (260k) inside my fpga I have tried two different
way: The first is with a loop with iowrite32() and wmb() the second is with
memcpy_toio(). Surprisingly the technique with a loop is near two time
faster than the memcpy_toio() ! Do you know why?

Finally what is (in your opinion) the better/faster way to write all my data
inside the fpga?

Thanks in advance for any kind of help. At this point any information will
help me!

Patrick


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

[Site Home]     [Linux ARM Kernel]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Tools]     [DDR & Rambus]     [Monitors]

Add to Google Google PageRank Checking tool