cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
adrianf0
Observer
Observer
1,481 Views
Registered: ‎01-25-2013

few drivers for a single IP module

Jump to solution

In my top-level block design, I have a custom module. The custom module contains another block design which includes an SPI block and 2 other custom sub-block - each with its own address space and interrupts.

At the moment HSI creates the following PL device tree:

 

        amba_pl: amba_pl {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
                ranges ;
                CLICpix2_0: CLICpix2@43c10000 {
                        compatible = "xlnx,CLICpix2-1.0";
                        interrupt-parent = <&intc>;
                        interrupts = <0 31 1 0 30 1 0 29 1>;
                        reg = <0x43c10000 0x1000 0x43c20000 0x1000 0x43c30000 0x10000>;
                };
};

I am aware of custom mdd and Tcl fils. However, how should I organize them, in order HSI creates the following device tree:

 

        amba_pl: amba_pl {                                                                                                                                                                                                                                                                 
                #address-cells = <1>;                                                                                                                                                                                                                                                      
                #size-cells = <1>;                                                                                                                                                                                                                                                         
                compatible = "simple-bus";                                                                                                                                                                                                                                                 
                ranges ;                                                                                                                                                                                                                                                                   
                CLICpix2_0: CLICpix2@43c10000 {                                                                                                                                                                                                                                            
                   compatible = "xlnx,CLICpix2-1.0";                                                                                                                                                                                                                                       
                   receiver_0: receiver@43c10000 {                                                                                                                                                                                                                                         
                           compatible = "xlnx,receiver-1.0";                                                                                                                                                                                                                               
                           interrupt-parent = <&intc>;                                                                                                                                                                                                                                     
                           interrupts = <0 31 1 >;                                                                                                                                                                                                                                         
                           reg = <0x43c10000 0x1000>;                                                                                                                                                                                                                                      
                  };                                                                                                                                                                                                                                                                       
                  control_0: control@43c20000 {                                                                                                                                                                                                                                            
                           compatible = "xlnx,receiver-1.0";                                                                                                                                                                                                                               
                           interrupt-parent = <&intc>;                                                                                                                                                                                                                                     
                           interrupts = <0 30 1 >;                                                                                                                                                                                                                                         
                           reg = <0x43c20000 0x1000>;                                                                                                                                                                                                                                      
                  };                                                                                                                                                                                                                                                                       
                  spi_0: spi@43c20000 {                                                                                                                                                                                                                                                    
                           compatible = "xlnx,xps-spi-2.00.a";                                                                                                                                                                                                                             
                           interrupt-parent = <&intc>;                                                                                                                                                                                                                                     
                           interrupts = <0 29 1 >;                                                                                                                                                                                                                                         
                           reg = <0x43c30000 0x10000>;                                                                                                                                                                                                                                     
                  };                                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                           
                };  

Is is possible to address this case with HSI tool?

 

 

 

0 Kudos
1 Solution

Accepted Solutions
adrianf0
Observer
Observer
1,826 Views
Registered: ‎01-25-2013

Although, as you suggested, I had to use hsi API and Tcl in order to achieve my goal, I haven't found a good existing example. Thus, as a reference, people with the similar problem may look for an inspiration in my code (link).

View solution in original post

0 Kudos
5 Replies
stephenm
Moderator
Moderator
1,464 Views
Registered: ‎09-12-2007
The DTG (devicetree generator), won't support this use case. You would need to create your own driver to the devicetree that would add the nodes for your "nested" IP via hsi API in a tcl file. You should take a look at the simple driver such as the GPIO for guidance here.

You would get the devicetree from GitHub, make your changes, create patch, add patch to petalinux (assuming you are using prtalinux)

However, is this worth the effort? Would you not just be best creating the device tree manually?
0 Kudos
adrianf0
Observer
Observer
1,431 Views
Registered: ‎01-25-2013

 @stephenm, thank you for your reply.

 

Anyway, as I would like to have a clean and generic solution, I would go with a hsi patch rather than device tree written manually.

 

I know how to create a regular driver. However, my problem is creation of 3 device tree nodes for a single IP module. I have taken a look at gpio example but didn't find any inspiration there (one ip - one node).

0 Kudos
stephenm
Moderator
Moderator
1,423 Views
Registered: ‎09-12-2007

There would be no example of drivers with your use-case. You would need to get all the IP at the same hierarchy as your IP (so the same parent cell), then add the nodes for these.

0 Kudos
adrianf0
Observer
Observer
1,827 Views
Registered: ‎01-25-2013

Although, as you suggested, I had to use hsi API and Tcl in order to achieve my goal, I haven't found a good existing example. Thus, as a reference, people with the similar problem may look for an inspiration in my code (link).

View solution in original post

0 Kudos
ibaie
Xilinx Employee
Xilinx Employee
1,371 Views
Registered: ‎10-06-2016
Hi @adrianf0,

Thanks for sharing your reference code, please mark it as solution ;)

Regards

Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos