How to use GPIO on LS1021A

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

How to use GPIO on LS1021A

跳至解决方案
2,046 次查看
maumontadrien
Contributor III
Hello, I will use GPIO 3_13 and 3_14 LS1021A but the documentation does not explain anything about it.
Could someone give me the steps to follow for that?
- Kernel configuration
- RCW modification ...  
ps: I use the rocko branch of yocto and the meta-freescale.
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,718 次查看
Pavel
NXP Employee
NXP Employee

If LS1021a GPIO1_15 is used, the LS1021a RCW UART_BASE bits should be cleared.

If LS1021a GPIO3_13 and GPIO3_15 are used, the LS1021a RCW EC1 bits should be set to 001.

See the Table 4-14 of the LS1021a Reference Manual.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
6 回复数
1,718 次查看
maumontadrien
Contributor III

I find the solution, the RCW is include in u-boot on yocto.

The binary on the folder "work/ls1021atwr-poky-linux-gnueabi/rcw/git-r0/git/ls1021atwr/SSR_PNS_30/rcw_1200_sdboot.bin" is not used by u-boot generation.

We should modified the binary "work/ls1021atwr-poky-linux-gnueabi/u-boot-qoriq/2017.09+fslgit-r0/git/board/freescale/ls1021atwr/ls102xa_rcw_sd_ifc.cfg". This is the only file used by yocto to generate the final u-boot.img.

0 项奖励
回复
1,719 次查看
Pavel
NXP Employee
NXP Employee

If LS1021a GPIO1_15 is used, the LS1021a RCW UART_BASE bits should be cleared.

If LS1021a GPIO3_13 and GPIO3_15 are used, the LS1021a RCW EC1 bits should be set to 001.

See the Table 4-14 of the LS1021a Reference Manual.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,718 次查看
maumontadrien
Contributor III

Should I change the RCW file to activate the GPIO control ?

0 项奖励
回复
1,718 次查看
Pavel
NXP Employee
NXP Employee

NXP SDK supports sysfs possibility for GPIO using.

 

Look at the following pages:

https://www.kernel.org/doc/Documentation/gpio/sysfs.txt

 

http://falsinsoft.blogspot.ru/2012/11/access-gpio-from-linux-user-space.html

 

https://wiki.openwrt.org/doc/hardware/port.gpio

 

http://linux-sunxi.org/GPIO

 

The sysfs driver has been tested and is working. It has been accepted into the mainline kernel.

The SysFs interface is a very simple way to access the GPIO from user space and has the advantage of requiring very little setup.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,718 次查看
maumontadrien
Contributor III

Thank you for your help. I have added the sysfs gpio support and the GPIO driver on my kernel configuration.

I detect the 4 gpiochip. I can set the device direction to "out". But when I want set the gpio value, the output voltage doesn't change. I test with differents GPIO (GPIO3_13, GPIO3_14, GPIO1_15).

0 项奖励
回复
1,154 次查看
Axent
Contributor II
0 项奖励
回复