How to set GPIO initial setting for i.MX8M Mini.

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

How to set GPIO initial setting for i.MX8M Mini.

Jump to solution
1,521 Views
tan-k
Contributor III

Hi,

We use custom board using i.MX8M Mini.
And we try to change OS based on Linux for i.MX (Linux 5.4.70_2.3.0).
We have some additional GPIO for output and input.
Could you please let us know how to set these direction in kernel?
We need to change device tree? Could you please show example?
Also, we need to get and set the value of GPIO in user space.

Any help would be appreciated.

Thank you.

Best regards,

0 Kudos
Reply
1 Solution
1,513 Views
igorpadykov
NXP Employee
NXP Employee

Hi TANAKA

 

>Could you please let us know how to set these direction in kernel?
>We need to change device tree? Could you please show example?

 

not possible to set direction and set the value of GPIO in device tree, one can

set them in uboot, example:

https://source.codeaurora.org/external/imx/uboot-imx/tree/board/freescale/imx8mm_evk/spl.c?h=imx_v20...

https://source.codeaurora.org/external/imx/uboot-imx/tree/include/asm-generic/gpio.h?h=imx_v2020.04_...


>Also, we need to get and set the value of GPIO in user space.

 

one can look at example

https://variwiki.com/index.php?title=MX8M_GPIO&release=RELEASE_HARDKNOTT_V1.0_DART-MX8M-MINI

 

Best regards
igor

View solution in original post

0 Kudos
Reply
2 Replies
1,514 Views
igorpadykov
NXP Employee
NXP Employee

Hi TANAKA

 

>Could you please let us know how to set these direction in kernel?
>We need to change device tree? Could you please show example?

 

not possible to set direction and set the value of GPIO in device tree, one can

set them in uboot, example:

https://source.codeaurora.org/external/imx/uboot-imx/tree/board/freescale/imx8mm_evk/spl.c?h=imx_v20...

https://source.codeaurora.org/external/imx/uboot-imx/tree/include/asm-generic/gpio.h?h=imx_v2020.04_...


>Also, we need to get and set the value of GPIO in user space.

 

one can look at example

https://variwiki.com/index.php?title=MX8M_GPIO&release=RELEASE_HARDKNOTT_V1.0_DART-MX8M-MINI

 

Best regards
igor

0 Kudos
Reply
1,498 Views
tan-k
Contributor III

Hi,

Thank you for your reply.
We referred to your URL and could set GPIO in uboot.
Also, we could set and get the value GPIO via /sys/class/gpio.

Best regards,

0 Kudos
Reply