when access a GPIO on iMX28

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

when access a GPIO on iMX28

ソリューションへジャンプ
1,914件の閲覧回数
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,171件の閲覧回数
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,172件の閲覧回数
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,171件の閲覧回数
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 件の賞賛
返信