Hi Bruno,
I don’t think you can do what
you’re trying to do, unless I’m misunderstanding or just not smart
enough.
The EDK from Xilinx ships with drivers
that are not Linux drivers. Those functions in main below are intended
for a standalone (no RTOS) system such they can’t just be called from a
user app in Linux. You are sort of trying to create a user mode driver
with what you are doing.
There is a character mode gpio driver in
the Xilinx git tree, git://git.xilinx.com/linux-2.6-xlnx.git that has been used
previously. I don’t currently test that driver as we’re in
the process of getting a flattened gpio driver that is not char driver ready
for mainline.
I plan to take a look at the char mode
gpio driver today as there’s another question regarding it on the list.
Thanks,
John
From: linuxppc-embedded-bounces+john.linn=xilinx.com@ozlabs.org
[mailto:linuxppc-embedded-bounces+john.linn=xilinx.com@ozlabs.org] On Behalf Of Bruno Monteiro
Sent: Tuesday, October 21, 2008
8:36 AM
To: linuxppc-embedded@ozlabs.org
Subject: Compile program using XGpio
Hi all,
I'm working with a Virtex2p. I have a running system using:
Now, i'm trying to build
a small program that turn off leds. I guess it should be something like this:
void main (void){
XGpio led;
XGpio_Initialize (&led, XPAR_LEDS_4BIT_DEVICE_ID);
XGpio_SetDataDirection(&led,1,0);
XGpio_DiscreteWrite(&led,1,0xf);
}
I want to know how to compile it (without EDK). Any suggestion?
Thanks,
Bruno Monteiro