GPIOs in the userspace (for FPGA programming)

Florian Fainelli florian at openwrt.org
Sat Mar 13 04:53:13 EST 2010


Hi Andres,

Le samedi 13 mars 2010 01:24:36, Andrés Calderón a écrit :
> Hi,
> 
> We are porting the xc3sprog[1] FPGA programes to the  SAKC, there are
> some example of using the Jz472x GPIOs to userspace ?

You can export the GPIOs using the gpiolib sysfs interface, so to export gpio 
number N, just do something like this:

echo N > /sys/class/gpio/export
echo out > /sys/class/gpio/gpioN/direction
echo 1 > /sys/class/gpio/gpioN/value

However, if you are to program a pretty big bitstream, this will be slow and 
since you are bit-banging the pins, your CPU will be almost 100% loaded with 
that task.

At some point someone proposed an API to program FPGA-s from kernel space [1], 
which saved some context switches, but this did not go anywhere, might be time 
to ressurect the thread.

[1]: http://lkml.indiana.edu/hypermail/linux/kernel/0812.1/01996.html

> 
> [1] http://sourceforge.net/projects/xc3sprog/
> 
> BR,
> 
> 
>     Andrés Calderón
>     Cel:     +57 (300) 275 3666
>     Email: andres.calderon at emqbit.com
>     Gtalk:  andresfcalderon at gmail.com
>     Web:    www.emqbit.com
> 
> _______________________________________________
> Qi Developer Mailing List
> Mail to list (members only): developer at lists.qi-hardware.com
> Subscribe or Unsubscribe:
>  http://en.qi-hardware.com/mailman/listinfo/developer
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.en.qi-hardware.com/pipermail/discussion/attachments/20100313/434c55a3/attachment.pgp>


More information about the discussion mailing list


interactive