Using GPIO

Guillaume Dargaud dargaud at lpsc.in2p3.fr
Mon May 19 21:56:12 EST 2008


Thanks for the answer,

> Dts files are not used with arch/ppc.
My question was more general, since arch/ppc will soon (?) disapear...

> In arch/ppc, the drivers that are in the system depend on the
> arch/ppc/platforms/4xx/xparameters/xparameters_ml405.h to setup the
> addresses of the devices and their configuration.
Yes, and I've taken care to define that.

> I looked at the ML405 setup in the git tree and it appears that it would
> need to be added to arch/ppc/syslib/virtex_devices.c. The platform data
> in virtex_devices.c must include the GPIO for it to be probed correctly.
> It should be easy for you to add the data to make it work.

Seems straightforward enough, but when I add the following:

// 0 is LEDS_4BIT, 1 is LEDS_POSITIONS, 2 is PUSH_BUTTONS_POSITION
#define XPAR_GPIO(num) { \
    .name = "xilinx_gpio", \
    .id = num, \
    .num_resources = 3, \
    .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

Then the boot stops right after "Uncompressing Linux...done.
Now booting the kernel"

I've probably overlooked something obvious, but I'm pretty new in putting my 
greasy fingers on delicate kernel internals...
In particular I don't know what is this .num_resources value.
-- 
Guillaume Dargaud
http://www.gdargaud.net/





More information about the Linuxppc-dev mailing list