Additional GPIOs in Linux

Started by aquarat, September 30, 2012, 04:48:26 PM

Previous topic - Next topic

aquarat

Hi

I'm trying to squeeze as many GPIOs out of the OLinuxino MAXI as possible. So far Linux pin 17/GPIO connector 4 causes the machine to lose network connectivity (LAN reset ?).

There are a number of pins on the GPIO header, many of which aren't listed for GPIO use in Linux... like GPIO connector pin 25/cpu pin 7, cpu pin 81, etc.

So my question is, how do you resolve a cpu pin to a Linux GPIO pin ?

Linux Pin  0 = GPIO Connector 19 = CPU Pin 22
Linux Pin  1 = GPIO Connector 17 = CPU Pin 23
Linux Pin 51 = GPIO Connector 18 = CPU Pin 14


What's the pattern ? Can pins outside of those listed on the "The Linux implementation of pins" table be used as GPIO pins in Linux ?

Thanks

Fadil Berisha

Hi aquarat,

The imx23 has four banks of pins, three of which can serve as GPIOs. Each bank contain 32 pins. Linux pins are calculated with schema -->

BANK_Number x 32 + pin.

Gpio function is available in bank 0,1 and 2. The last bank contains the EMI high speed pins which are not muxed with other functions due to tight timing requirements to memory. Gpio pins operate at a fixed nominal voltage of 3.3V.
You can find definitions for all pins in kernel file iomux-mx23.h. Here is only portion:

/ * BANK  PIN MUX    */
/* MUXSEL_GPIO */                                                   |   |        |
                                                                    |   |        |
#define MX23_PAD_GPMI_ALE__GPIO_0_17 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_GPIO)



So pin name GPMI_ALE used as gpio has linux kernel number 0*32+17 = 17


Regards
Fadil Berisha




dpwhittaker

#2
I've added the Maxi GPIO connector to my micro pinout spreadsheet.  I'll get the UEXT connector mapped out next, but it is equivalent to CON2, pin 5-14 on the micro.

https://docs.google.com/spreadsheet/ccc?key=0AspkrcYcY5bWdFB6WC1xRlp5bFRjc1hwVnlQZDVmeUE

Just look at the second sheet labeled maxi.

aquarat

Wow, thank you very much, you've both answered the question very well :D .