GPIOs number of the IMX93

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

GPIOs number of the IMX93

ソリューションへジャンプ
1,617件の閲覧回数
Embedded-world
Contributor IV

Dear Experts,

I'm working on the IMX93 board bring-up. During testing of the RS485 peripherals, we used one of the GPIO pins (i.e., GPIO2_IO00) to toggle between logic 0 and logic 1.

While researching resources about GPIO configuration for the IMX93, I came across the method to find GPIO numbers using:

cat /sys/kernel/debug/gpio
 

Our board is based on the IMX9352 processor. For GPIO2_IO00, I used the GPIO number 512,
Screenshot 2025-01-27 112838.png
and it worked correctly for the board. but, I would like to understand how this GPIO is configured. How is the GPIO number calculated for the IMX93 processor? Is there a specific formula for determining this? If so, could you please provide it?

 

Thanks & Regards

Ravikumar

0 件の賞賛
返信
1 解決策
1,596件の閲覧回数
Manuel_Salas
NXP TechSupport
NXP TechSupport

Hello @Embedded-world 

 

I hope you are doing very well.

 

Linux kernel base the GPIO number based on the index, in this case:

  • gpiochip0: GPIOs 512-543, parent: platform/43810000 (real GPIO is GPIO2)
  • gpiochip1: GPIOs 544-575, parent: platform/43820000 (real GPIO is GPIO3)
  • gpiochip2: GPIOs 576-607, parent: platform/43830000 (real GPIO is GPIO4)
  • gpiochip3: GPIOs 608-639, parent: platform/47400000 (real GPIO is GPIO1)

But as I said, Linux kernel take as reference the index, so Real index:

  • Real GPIO2 is Index 0
  • Real GPIO3 is Index 1
  • Real GPIO4 is Index 2
  • Real GPIO1 is Index 3

You can use this formula to calculate your desired pin:

 

GPIO_NUMBER = GPIO_BASE_INDEX + PIN_INDEX

 

As example, we can take the GPIO2_IO00:

GPIO_NUMBER = (512) + (0) = 512.

 

Also, you can take a look to the gpiod tool installed by default in our BSP. It is easy to use (gpiodetect, gpioset, gpioget, etc.):

Alejandro_Salas_0-1738084836544.png

 

I hope this can helps to you.

 

Best regards,

Salas.

元の投稿で解決策を見る

2 返答(返信)
1,584件の閲覧回数
Embedded-world
Contributor IV

Hi @Manuel_Salas 

Thanks for sharing the this information, It's very useful.

 

 

 

Best Regards,

Ravikumar

1,597件の閲覧回数
Manuel_Salas
NXP TechSupport
NXP TechSupport

Hello @Embedded-world 

 

I hope you are doing very well.

 

Linux kernel base the GPIO number based on the index, in this case:

  • gpiochip0: GPIOs 512-543, parent: platform/43810000 (real GPIO is GPIO2)
  • gpiochip1: GPIOs 544-575, parent: platform/43820000 (real GPIO is GPIO3)
  • gpiochip2: GPIOs 576-607, parent: platform/43830000 (real GPIO is GPIO4)
  • gpiochip3: GPIOs 608-639, parent: platform/47400000 (real GPIO is GPIO1)

But as I said, Linux kernel take as reference the index, so Real index:

  • Real GPIO2 is Index 0
  • Real GPIO3 is Index 1
  • Real GPIO4 is Index 2
  • Real GPIO1 is Index 3

You can use this formula to calculate your desired pin:

 

GPIO_NUMBER = GPIO_BASE_INDEX + PIN_INDEX

 

As example, we can take the GPIO2_IO00:

GPIO_NUMBER = (512) + (0) = 512.

 

Also, you can take a look to the gpiod tool installed by default in our BSP. It is easy to use (gpiodetect, gpioset, gpioget, etc.):

Alejandro_Salas_0-1738084836544.png

 

I hope this can helps to you.

 

Best regards,

Salas.