when access a GPIO on iMX28

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

when access a GPIO on iMX28

跳至解决方案
2,564 次查看
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.

标签 (2)
0 项奖励
回复
1 解答
1,821 次查看
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 项奖励
回复
2 回复数
1,822 次查看
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 项奖励
回复
1,821 次查看
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 项奖励
回复