This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Which GPIO is which physical pin in linux?

Hi!

I'm working on porting the 2.6.37-patch version of the PSP kernel to a new board which is based on the TI816X EVM. The hardware is very similar, and I have linux up and running on the target platform. The processor is a TMS320C6A8168.

So right now I'm trying to blink three LEDs which are connected to GP1[0,1,2]. However I am a bit confused on exactly how to do this. I have tried to study the documentation, but I have a lot of loose ends, so excuse me if I sound a bit confused.

Some background:
I added muxing information in the arch/arm/mach-omap2/board-ti8168evm.c. So the pins should be set up correctly.

I have created a kernel module which exposes a GPIO via the SysFS interface.

However, I do not know which GPIO corresponds to which physical pin. Is there some table I could check out?

Do I need to export gpiochip1? If so, how do I do that?

It seems to me that the GPIO implementation is OMAP-specific, is there some documentation describing this implementation?

Any help is appreciated :)

Thanks,
Emil

  • Hi Emil,

    Anil: Go through the GPIO driver user guide http://processors.wiki.ti.com/index.php/Sitara_GPIO_Driver_User_Guide

    Some background:
    I added muxing information in the arch/arm/mach-omap2/board-ti8168evm.c. So the pins should be set up correctly.

    Anil: Follow the user guide (Introduction)

    I have created a kernel module which exposes a GPIO via the SysFS interface.

    Anil: This is not required, all the GPIO lines are exported as Sysfs entries. Make sure that same GPIO's are not used by other drivers

    However, I do not know which GPIO corresponds to which physical pin. Is there some table I could check out?

    Anil: It's simple, BANK_NUMBER * 32 + 0 is the GPIO starting number.

    Eg: GP1_IO0 is 1*32+0 = 32 is the GPIO number for GPIO bank one IO number 0. 

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!