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

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

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

ソリューションへジャンプ
1,522件の閲覧回数
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 件の賞賛
返信
1 解決策
1,514件の閲覧回数
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 件の賞賛
返信
2 返答(返信)
1,515件の閲覧回数
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 件の賞賛
返信
1,499件の閲覧回数
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 件の賞賛
返信