Building custom LS1012A-FRWY image

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

Building custom LS1012A-FRWY image

940 Views
gabriele_coppol
Contributor II

Hi all,

i'm actually working on a LS1012A-FRWY (rev-B so with 512MB of DDR) and I would like to drive the GPIOs 1_27 (bank 0) and 2_03 (bank 1). For the first one, I had to modify the RCW since multiplexing default configuration was different. I also modified .dts since, building from scratch the image, they weren't included.

The problem is under linux there is no /sys/class/gpio folder.

I tried with lsdk 18.09. LSDK 19.03 has the problem that I cannot say anywhere that my board is a rev-B so it supposes to have 1GB of DDR, and booting up, at a certain point of memory scanning I get an error saying that the memory space is not as expected (or something similar, I don't remember exacty).

Could you detail me exactly all steps for building a custom image with these customizations?

Thanks in advance.

3 Replies

711 Views
Pavel
NXP Employee
NXP Employee

LSDK supports sysfs for GPIO using.

See the following pages:

http://man7.org/linux/man-pages/man5/sysfs.5.html

 

and

 

https://www.kernel.org/doc/html/latest/admin-guide/sysfs-rules.html

 

See the ls1012afrwy.h file in the /include/configs folder of u-boot source.

The following path is used for u-boot source:

/LSDK1903/flexbuild_lsdk1903/packages/firmware/u-boot

 

This file defines SDRAM size 512KB for REV A_B and 1024KB for REV C.

Change SDRAM size for your board and rebuild u-boot using the following command:

flex-builder -c uboot -m ls1012afrwy -b qspi


Have a great day,
Pavel Chubakov

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

711 Views
gabriele_coppol
Contributor II

Hi Pavel,

thank you for your reply.

With LSDK 19.03, I'm now able to upload a compatible bsp just using the *_512mb* image generated together with the other one (named as the previous LSDK version outputs).

Here there are my .dts and my rcw. I built everything and generated both bsp (rcw, uboot,...) (uploaded via tftp) and rootfs.

  • With my BSP and my roofts I don't see /sys/class/gpio folder
  • With my BSP and the download pre-built rootfs I see /sys/class/gpio; exporting the gpio, setting the output direction and acting on /sys/class/gpio/gpio506/value I'm still not able to see the LED changing its value.

gpiochip0 (GPIO1) number range is 448-479

gpiochip1 (GPIO2) number range is 480-511

So I think there is still something missing in the configuration.

Concerning the pushbutton (connected to GPIO2_03) I tried to configure it with the input direction and falling edge. Under /proc/interrupts now I can see the new line but pressing the button the number of interrupts is still 0. Also keeping pushed and monitoring  /sys/class/gpio/gpio450/value it is not changing its status.

0 Kudos

711 Views
gabriele_coppol
Contributor II

In addition, with the provided pre-built image GPIO2_03 should be already connected and with that image I can see /sys/class/gpio folder. So I can export the correct gpio number (450, since gpiochip1 starts from 448) but setting input direction and falling edge under /sys/class/gpio/gpio450/ I'm not able to see any changes in /sys/class/gpio/gpio450/value both pressing or not the pushbutton connected to that pin. I verified the pushbutton output with an oscilloscope.

0 Kudos