GPIOs in the userspace (for FPGA programming)

Florian Fainelli florian at
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]
> BR,
>     Andrés Calderón
>     Cel:     +57 (300) 275 3666
>     Email: andres.calderon at
>     Gtalk:  andresfcalderon at
>     Web:
> _______________________________________________
> Qi Developer Mailing List
> Mail to list (members only): developer at
> Subscribe or Unsubscribe:

-------------- 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: <>

More information about the discussion mailing list