linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: Using GPIO
@ 2008-06-06  7:51 Ludovic Desroches
  2008-06-06 16:09 ` Guillaume Dargaud
  0 siblings, 1 reply; 10+ messages in thread
From: Ludovic Desroches @ 2008-06-06  7:51 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1766 bytes --]

Hi,

I am also trying to use Xilinx GPIO driver on my board but I encounter some
problems. I thought they will be resolved with this information but it
doesn't.

I use GPIO driver as built-in but during kernel boot but I don't see log
about it contrary to Xemac driver for instance. First I wanted to create my
gpio driver normally without using Xilinx one, with ioremap and writel/readl
but I didn't write anything in the register, I don't know why. Then I tried
to use Xilinx GPIO driver but I don't know why I don't hit xgpio_probe,
xgpio_init returns 0 so it's OK.

Do you have any idea ?

Thanks

Ludovic Desroches


> arch/ppc/syslib/virtex_devices.c:
>
> >* // 0 is LEDS_4BIT, 1 is LEDS_POSITIONS, 2 is PUSH_BUTTONS_POSITION
> *>* #define XPAR_GPIO(num) { \
> *>*    .name = "xilinx_gpio", \
> *>*    .id = num, \
> *>*    .num_resources = 2, \
> *That was a 2.
> If anybody wants to make a patch out of those few lines of code, I couldn't
> figure out how to do this with git... But I will use a more general GPIO
> approach as soon as I can put my hands on our custom card.
>
> >*    .resource = (struct resource[]) { \
> *>*        { \
> *>*            .start = XPAR_GPIO_##num##_BASEADDR, \
> *>*            .end = XPAR_GPIO_##num##_HIGHADDR, \
> *>*            .flags = IORESOURCE_MEM, \
> *>*        }, \
> *>*        { \
> *>*            .start = XPAR_INTC_0_GPIO_##num##_VEC_ID, \
> *>*            .flags = IORESOURCE_IRQ, \
> *>*        }, \
> *>*    }, \
> *>* }
> *>* [...]
> *>*      /* GPIO instances */
> *>* #if defined(XPAR_GPIO_0_BASEADDR)
> *>*      XPAR_GPIO(0),
> *>* #endif
> *>* #if defined(XPAR_GPIO_1_BASEADDR)
> *>*      XPAR_GPIO(1),
> *>* #endif
> *>* #if defined(XPAR_GPIO_2_BASEADDR)
> *>*      XPAR_GPIO(2),
> *>* #endif
> *
>
>

[-- Attachment #2: Type: text/html, Size: 2293 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: Using GPIO
@ 2008-05-19 15:23 Guillaume Dargaud
  0 siblings, 0 replies; 10+ messages in thread
From: Guillaume Dargaud @ 2008-05-19 15:23 UTC (permalink / raw)
  To: linuxppc-dev

arch/ppc/syslib/virtex_devices.c:

> // 0 is LEDS_4BIT, 1 is LEDS_POSITIONS, 2 is PUSH_BUTTONS_POSITION
> #define XPAR_GPIO(num) { \
>    .name = "xilinx_gpio", \
>    .id = num, \
>    .num_resources = 2, \
That was a 2.
If anybody wants to make a patch out of those few lines of code, I couldn't 
figure out how to do this with git... But I will use a more general GPIO 
approach as soon as I can put my hands on our custom card.

>    .resource = (struct resource[]) { \
>        { \
>            .start = XPAR_GPIO_##num##_BASEADDR, \
>            .end = XPAR_GPIO_##num##_HIGHADDR, \
>            .flags = IORESOURCE_MEM, \
>        }, \
>        { \
>            .start = XPAR_INTC_0_GPIO_##num##_VEC_ID, \
>            .flags = IORESOURCE_IRQ, \
>        }, \
>    }, \
> }
> [...]
>      /* GPIO instances */
> #if defined(XPAR_GPIO_0_BASEADDR)
>      XPAR_GPIO(0),
> #endif
> #if defined(XPAR_GPIO_1_BASEADDR)
>      XPAR_GPIO(1),
> #endif
> #if defined(XPAR_GPIO_2_BASEADDR)
>      XPAR_GPIO(2),
> #endif

-- 
Guillaume Dargaud
http://www.gdargaud.net/

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Using GPIO
@ 2008-05-15 16:35 Guillaume Dargaud
  2008-05-15 18:39 ` John Bonesio
  0 siblings, 1 reply; 10+ messages in thread
From: Guillaume Dargaud @ 2008-05-15 16:35 UTC (permalink / raw)
  To: linuxppc-dev

Hello all,
I'm trying to use the Xilinx GPIO from a user program.
Since I haven't managed to compile their example (simon.c is given without a 
makefile), I wanted to try using /dev/gpio...

So I added
/dev/gpio0  c  666  0  0  10  185 -  -  -
to device_table.txt when I generated my root filesystem with buildroot, but 
apparently this leads nowhere as it's not visible in /proc/devices.

Is there some example or tutorial on how to use CONFIG_XILINX_GPIO ? Either 
as a device or as API calls...
-- 
Guillaume Dargaud
http://www.gdargaud.net/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-06-06 16:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-06  7:51 Using GPIO Ludovic Desroches
2008-06-06 16:09 ` Guillaume Dargaud
  -- strict thread matches above, loose matches on Subject: below --
2008-05-19 15:23 Guillaume Dargaud
2008-05-15 16:35 Guillaume Dargaud
2008-05-15 18:39 ` John Bonesio
2008-05-15 18:56   ` Stephen Neuendorffer
2008-05-16  8:15   ` Guillaume Dargaud
2008-05-16 16:17     ` John Linn
2008-05-19 11:56       ` Guillaume Dargaud
2008-05-19 13:42         ` Josh Boyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).