GPIOs in the userspace (for FPGA programming)

zhan han zhanhan.cn at gmail.com
Sat Mar 13 05:00:20 EST 2010


Basically, you can map the memory address of registers and do set or
get operation.

On Sat, Mar 13, 2010 at 5:53 PM, Florian Fainelli <florian at openwrt.org> wrote:
> 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
>>
>
>
> _______________________________________________
> 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
>




More information about the discussion mailing list


interactive