cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
252 Views
Registered: ‎03-12-2018

Not able to interpret how to and What to write in system-user.dtsi?

Jump to solution

Hi there,

I'm a newbie in Embedded Linux. As of now I'm just bale to boot up the system with the Petalinux User Guide. I have to configure Kernal, rootfs to enable modules or libraries. 

Wile reading Xilinx-Confluence website for Linux Device Drivers, it asked to make changes in system-user.dtsi which will update the device tree.

Now, here are my some basic questions -  

  1. How do I know what to write in system-user.dtsi.?
  2. I would like to know how to generate the script for system-user.dtsi file (basically what to write in user.dtsi)??
  3. Is there any standard file of dtsi / user guide, from which I can copy the required scripts into user.dtsi to make it working.?

Any help in the direction to know How to Write and What to write in system-user.dtsi??  is Appriciated.

I'm working on a USB based camera which I wanted to interface with ZC7020 Zynq 7000.

Looking forward to get quick and positive response.

Thanks and Warm Regard,

Lokesh

 

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
177 Views
Registered: ‎09-12-2007

The cells are discussed here:

https://elinux.org/Device_Tree_Usage

For the address, and the range. If you are using a memory mapped IP (ie connected to your processor), then this will be handled for you by the devicetree generator

I wouldnt just copy and paste from a wiki without understanding what you are doing. You will just make errors.

 

If you want to test, the syntax and to isolate the build, and compile from petalinux, then use the wiki below:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/341082130/Quick+guide+to+Debugging+Device+Tree+Generator+Issues

 

View solution in original post

4 Replies
Highlighted
Voyager
Voyager
231 Views
Registered: ‎08-02-2019

Hi @lokesh_oepl ,

Actually, nobody can say you need to write this terms into your system-user.dtsi, because it depends you and what you want to achieve.

First thing is first:

What is system-user.dtsi?

Before system-user.dtsi, you need to know, what is pl.dtsi?

You can search pl.dtsi in your Petalinux folder and see:

Your GPIO cores, your interrupts cores, custom IP cores comes automatically here after updating your petalinux-config with your new Vivado hdf file.

So, pl.dtsi is generated by Petalinux automatically.

What if you want to change or add some extra items on your device-tree?

Then you need to change system-user.dtsi. About writing rules you need to keep it's current format and you can look pl.dtsi file format also.

Nested "{", "}" and ";" are very important.

What do you need to write in system-user.dtsi?

It depends your design.

For example:

You want to use interrupts on Petalinux and you need to enable uio drivers. Then you can find related Xilinx documantation and add related parts into your system-user.dtsi file.

/include/ "system-conf.dtsi"
/ {
    chosen {
        bootargs = "earlycon clk_ignore_unused   uio_pdrv_genirq.of_id=generic-uio";
        stdout-path = "serial0:115200n8";
    };
};
  
&axi_gpio_0 {
    compatible = "generic-uio";
};

For example:

You want set some reserved memory for DMA, then you can find related modifications in this Xilinx Wiki.

 

/include/ "system-conf.dtsi"
/ {
   reserved-memory {
      #address-cells = <1>;
      #size-cells = <1>;
      ranges;
  
      reserved: buffer@0x38000000 {
         no-map;
         reg = <0x38000000 0x08000000>;
      };
   };
  
   reserved-driver@0 {
      compatible = "xlnx,reserved-memory";
      memory-region = <&reserved>;
   };
};

As a result, what you need to write in system-user.dtsi, depends completely your needs.

Saban

 

 

<--- If reply is helpful, please feel free to give Kudos, and close if it answers your question --->
Highlighted
Moderator
Moderator
207 Views
Registered: ‎09-12-2007

The Petalinux tools uses a utility called the devicetree generator (or DTG) to create the devicetree nodes. The DTG uses the HDF/XSA file as an input. So, since the HDF/XSA only contains IP in the block design, then the DTG will only add nodes for IP in the device. However, users have IP external to the device such as ethernet PHYs, devices on the I2C, ect.

So, in order to add these nodes users can add these to the system-user.dtsi (project-spec\meta-user\recipes-bsp\device-tree\files)

Users, can add nodes, or modify existing nodes. For example:

&your_node {

   you_data_here;

};

 

Each driver has a devicetree binding. This will have the info needed by your IP driver that should be passed via the devicetree

0 Kudos
Highlighted
Adventurer
Adventurer
191 Views
Registered: ‎03-12-2018

Hi @sabankocal ,

Thank you for quick and detailed response.

Whatsoever is part of hdf/xsa file will come as part of pl.dtsi and other than that if I wanted to use drives which are connected to PS (e.g. Ethernet, USB as HOST / OTG, interrupt, which is related to ARM A9), I need to write such details into system-user.dtsi.

Is this what you meant.?? Am I interpreted your information Correctly.??

Now I have following questions - 

Where will I find the details regarding the cell size, address size, range.??

You have written reserve:buffer@0x38000000, why no-map has written?, etc.

Basically, from where did get to know the exact syntax?? How did you write it by your own ?? Did you refer some basic and standard guide.?? 

Can I directly copy the device trees from xilinx confluence and paste it in user.dtsi file.??

What do I need to take care of before doing so.??

 

I'm asking this many questions, because, I'm not finding relevant details any where. I hope you experts will help me to get though. @sabankocal @stephenm 

Thanks and Warm Regards

Lokesh  

 

 

0 Kudos
Highlighted
Moderator
Moderator
178 Views
Registered: ‎09-12-2007

The cells are discussed here:

https://elinux.org/Device_Tree_Usage

For the address, and the range. If you are using a memory mapped IP (ie connected to your processor), then this will be handled for you by the devicetree generator

I wouldnt just copy and paste from a wiki without understanding what you are doing. You will just make errors.

 

If you want to test, the syntax and to isolate the build, and compile from petalinux, then use the wiki below:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/341082130/Quick+guide+to+Debugging+Device+Tree+Generator+Issues

 

View solution in original post