UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
2,215 Views
Registered: ‎01-26-2017

Are Petalinux Device Tree Modifcations required?

Jump to solution

Hi,

 

Just a question concerning device trees. If I add a kernel module using petalinux-create -t modules ..., I can replace the default generated module with my own *.c module. Then I can configure the rootfs to include that module.

 

Do I need to modify the device tree at all? Even just to include a reference to other dts files? Or is it all taken care of by the auto DTB generator, and all I have to do is use the correct names/ compat strings?

 

Thanks

--- Estimated Development time: 2*Pi*(planned completion date) ---
0 Kudos
1 Solution

Accepted Solutions
Explorer
Explorer
3,229 Views
Registered: ‎10-04-2017

Re: Are Petalinux Device Tree Modifcations required?

Jump to solution

  So there are two different things.  If there is an IP block in your design that accessible then that will be in the hdf and therefor the nodes will be generated in the devicetree.  And yes, you can write a driver that has a compat string to match that node and you can use the addresses defined in the devicetree node.

 

  If you are writing a purely "software" driver(one that does not directly access the PL), like a proxy driver that provides the interface between userspace and the Linux DMA API,  then you would have to add that node manually.

View solution in original post

0 Kudos
8 Replies
Moderator
Moderator
2,194 Views
Registered: ‎04-24-2017

Re: Are Petalinux Device Tree Modifcations required?

Jump to solution

Hi @aaron_holliday,

 

When you create modules by default doesn't have any entry device-tree in drivers. 

 

If you need device-tree entry you can add in driver modules and then create dt nodes in system-user.dtsi 

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Adventurer
Adventurer
2,165 Views
Registered: ‎01-26-2017

Re: Are Petalinux Device Tree Modifcations required?

Jump to solution
Hi @sandeepg
what are some of cases where you would need to create deivce tree entries? I'm trying to add a character device driver for AXI-DMA at the moment, will I need to make a device tree entry? I noticed in the PL dtsi that the DMA node was in the device tree already
--- Estimated Development time: 2*Pi*(planned completion date) ---
0 Kudos
Explorer
Explorer
2,161 Views
Registered: ‎10-04-2017

Re: Are Petalinux Device Tree Modifcations required?

Jump to solution
The tools will generate nodes for blocks that are defined in the hdf/hardware design. If you are creating a kernel driver, say a dma proxy driver, you need to create your own devicetree entry.
0 Kudos
Adventurer
Adventurer
2,157 Views
Registered: ‎01-26-2017

Re: Are Petalinux Device Tree Modifcations required?

Jump to solution
@jrhtech so I can't just refer to the nodes generated by the .hdf in my .ko module? I need to manually add in the addresses etc? Should I add this 'driver' node to the system-user.dtsi? Thanks
--- Estimated Development time: 2*Pi*(planned completion date) ---
0 Kudos
Explorer
Explorer
3,230 Views
Registered: ‎10-04-2017

Re: Are Petalinux Device Tree Modifcations required?

Jump to solution

  So there are two different things.  If there is an IP block in your design that accessible then that will be in the hdf and therefor the nodes will be generated in the devicetree.  And yes, you can write a driver that has a compat string to match that node and you can use the addresses defined in the devicetree node.

 

  If you are writing a purely "software" driver(one that does not directly access the PL), like a proxy driver that provides the interface between userspace and the Linux DMA API,  then you would have to add that node manually.

View solution in original post

0 Kudos
Adventurer
Adventurer
2,146 Views
Registered: ‎01-26-2017

Re: Are Petalinux Device Tree Modifcations required?

Jump to solution
@jrhtech - I think I would need to write the proxy driver, since I am using character driver for PS-PL AXI-DMA communication. I have used the AXI-DMA IP in Vivado, so I guess I would need to modify the device tree to allow userspace access via mmap(...). Thanks
--- Estimated Development time: 2*Pi*(planned completion date) ---
0 Kudos
Explorer
Explorer
2,118 Views
Registered: ‎10-04-2017

Re: Are Petalinux Device Tree Modifcations required?

Jump to solution

Right, I did a proxy driver for an image processing pipeline using VDMA and just added a node for proxy driver.

0 Kudos
Adventurer
Adventurer
2,109 Views
Registered: ‎01-26-2017

Re: Are Petalinux Device Tree Modifcations required?

Jump to solution
@jrhtech cool, actually I'm doing something similar. I'm doing image processing in PL, and sending out data via PS - I'm attempting to use regular AXI-DMA to move the data across.
--- Estimated Development time: 2*Pi*(planned completion date) ---
0 Kudos