Welcome, Guest

Author Topic: Additional GPIOs in Linux  (Read 3209 times)

aquarat

  • Newbie
  • *
  • Posts: 44
  • Karma: +1/-0
Additional GPIOs in Linux
« on: September 30, 2012, 04:48:26 PM »
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

  • Full Member
  • ***
  • Posts: 124
  • Karma: +7/-0
Re: Additional GPIOs in Linux
« Reply #1 on: September 30, 2012, 08:38:42 PM »
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:
Code: [Select]
/ * 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

  • Newbie
  • *
  • Posts: 38
  • Karma: +0/-0
Re: Additional GPIOs in Linux
« Reply #2 on: October 01, 2012, 12:51:39 AM »
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.
« Last Edit: October 01, 2012, 01:24:35 AM by dpwhittaker »

aquarat

  • Newbie
  • *
  • Posts: 44
  • Karma: +1/-0
Re: Additional GPIOs in Linux
« Reply #3 on: October 01, 2012, 01:30:57 AM »
Wow, thank you very much, you've both answered the question very well :D .