How do you configure the Device Tree on Red Pitaya

Applications, development tools, FPGA, C, WEB
Post Reply
xyefa
Posts: 54
Joined: Tue Feb 02, 2016 8:42 pm

How do you configure the Device Tree on Red Pitaya

Post by xyefa » Sat Apr 23, 2016 1:54 am

Hello,

I am porting a Raspberry PI driver to Red Pitaya. However I do not know how to modify the Device Tree on the Red Pitaya. Any pointers would help.

Regards!

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: How do you configure the Device Tree on Red Pitaya

Post by Nils Roos » Sat Apr 23, 2016 10:36 am

Hi,

in the course of the build process, the devicetree source is first generated from the ZYNQ configuration data and then patched to account for Red Pitaya specifics. If you want to insert your own nodes, you would do that by adding them to this patch.

xyefa
Posts: 54
Joined: Tue Feb 02, 2016 8:42 pm

Re: How do you configure the Device Tree on Red Pitaya

Post by xyefa » Tue Jun 14, 2016 6:00 pm

I am trying to add a RaspberryPi FBTFT (LCD Display) driver to the RedPitaya - https://github.com/notro/fbtft.git

My understanding is that I add the FBTFT Device Tree to the Red Pitaya Device Tree and then I add the code for the driver in the relevant driver directory. Is this correct?

The FBTFT Readme says the following:


Development is done on a Raspberry Pi running the Raspbian "wheezy" distribution.

INSTALLATION
Download kernel sources

From Linux 3.15
cd drivers/video/fbdev
git clone https://github.com/notro/fbtft.git

Add to drivers/video/fbdev/Kconfig: source "drivers/video/fbdev/fbtft/Kconfig"
Add to drivers/video/fbdev/Makefile: obj-y += fbtft/

Before Linux 3.15
cd drivers/video
git clone https://github.com/notro/fbtft.git

Add to drivers/video/Kconfig: source "drivers/video/fbtft/Kconfig"
Add to drivers/video/Makefile: obj-y += fbtft/

Enable driver(s) in menuconfig and build the kernel

See wiki for more information: https://github.com/notro/fbtft/wiki

Source: https://github.com/notro/fbtft/

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: How do you configure the Device Tree on Red Pitaya

Post by Nils Roos » Tue Jun 14, 2016 7:42 pm

Basically it's correct, with some additional things to mention.
  • the linux source is extracted from a downloaded archive, so it's not totally straight forward to add the driver code for a fresh checkout - you could mimic the method the "rtl8192cu" and "lantiq" drivers are added to the kernel source in the Red Pitaya build
  • for the same reason, adding the changes in Kconfig and Makefile (according to 3.15+ directions) are best done by patching
  • because the devicetree is generated during build, the dts parts have to be added to the patch mentioned in a previous post
  • you also have to add the config settings for the new driver to the linux...config.patch in order for them to be included in the kernel build

xyefa
Posts: 54
Joined: Tue Feb 02, 2016 8:42 pm

Re: How do you configure the Device Tree on Red Pitaya

Post by xyefa » Wed Jun 15, 2016 12:26 am

Okay this is helpful information.

I assume that I also need to edit the RaspberryPi Device Tree file for this particular driver, because the bindings would be different.

Regards!

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: How do you configure the Device Tree on Red Pitaya

Post by Nils Roos » Fri Jun 17, 2016 8:12 pm

As far as I can determine with only basic knowledge about devicetrees, you should retarget the spi components of the RPi dts from spi0 to spi1, because spi1 is the bus that's available on extension connector E2.

I am uncertain about what to do with the gpio assignments, though.

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 104 guests