How to use GPIO on LS1021A

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

How to use GPIO on LS1021A

Jump to solution
1,692 Views
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.
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,364 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
6 Replies
1,364 Views
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 Kudos
Reply
1,365 Views
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 Kudos
Reply
1,364 Views
maumontadrien
Contributor III

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

0 Kudos
Reply
1,364 Views
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 Kudos
Reply
1,364 Views
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 Kudos
Reply
800 Views
Axent
Contributor II
0 Kudos
Reply