when access a GPIO on iMX28

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

when access a GPIO on iMX28

Jump to solution
1,615 Views
yongkimin
Contributor III

Hi I ask access a GPIO port on my imx28 platform board.

At first I say thanks to the answer (https://community.freescale.com/message/365311#365311) to Yuri.

According to Yuri's guide I check the /sys/class/gpio as below.

root@freescale /sys/class/gpio$ ls -l

-rwxrwxrwx    1 root     root         4096 Jan  1 20:54 export

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip128 -> ../../devices/virtual/gpio/gpiochip128

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip32 -> ../../devices/virtual/gpio/gpiochip32

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip64 -> ../../devices/virtual/gpio/gpiochip64

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip96 -> ../../devices/virtual/gpio/gpiochip96

--w-------    1 root     root         4096 Jan  1 19:40 unexport

As you can see after configuration (CONFIG_GPIO_SYSFS) and re-build uImage I see the gpio sysfs.

TRe: how to access GPIO on imx28)

But I can't access the GPIO pin after update uImage.

root@freescale /sys/class/gpio$ echo 36 > /sys/class/gpio/export

root@freescale /sys/class/gpio$ ls -l

-rwxrwxrwx    1 root     root         4096 Jan  2 00:00 export

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip128 -> ../../devices/virtual/gpio/gpiochip128

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip32 -> ../../devices/virtual/gpio/gpiochip32

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip64 -> ../../devices/virtual/gpio/gpiochip64

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip96 -> ../../devices/virtual/gpio/gpiochip96

--w-------    1 root     root         4096 Jan  1 19:40 unexport

36 is pin of SSP0_DATA4 and is BANK2_PIN04. After export could not see the gpio.

I did modify mx28evk_fixed_pins the MUX pin of mx28evk_pins.c file in LINUX/arch/arm/march-mx28.

Labels (2)
0 Kudos
1 Solution
872 Views
yongkimin
Contributor III

I did it and refer my other answer (Re: how to access GPIO on imx28).

Other answer is some different in my case. I hope my answer help to you.

Thanks.

View solution in original post

0 Kudos
2 Replies
873 Views
yongkimin
Contributor III

I did it and refer my other answer (Re: how to access GPIO on imx28).

Other answer is some different in my case. I hope my answer help to you.

Thanks.

0 Kudos
872 Views
yongkimin
Contributor III

The modifing is in mx28evk_fixed_pins is

{

  .name = "SSP0_DATA4",

  .id = PINID_SSP0_DATA4,

  .fun = PIN_GPIO,

  .strength = PAD_4MA,

  .voltage = PAD_3_3V,

  .pullup = 1,

  .drive = 1,

  .pull = 1,

  .data = 1,

  .output = 1,

},

I can' understand why I can't access the pin.

Anybody can answer that.

Thanks.

0 Kudos