cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bfung_2
Contributor
Contributor
529 Views
Registered: ‎07-02-2020

peta-linux DTG

Jump to solution

There is a bit of a gap in my knowledge I'm hoping to cross. I'm going through the process of generating a boot image and rootFS for a zynq 7020 that lives on a custom board. Following the instructions (UG1144), I run:

petalinux-config --get-hw-description <PATH-TO-XSA Directory>/--get-hw-description=<PATH-TO_XSA Directory>

then the system menu config pops up and I then make sure target is replaced by zc702:

DTG Settings → → (target) MACHINE_NAME

  • I don't quite understand why we are basing the DTG build process off the development board if I'm targeting the same chip for a different "custom" board?
  • Will the final DTB be usable on my custom board if I maintain this step?
  • For that matter, if I want to compile boot products for ANY zynq chip with petalinux, would I just find the closest Xilinx dev board that contains that chip and use that for the DTG MACHINE_NAME?
0 Kudos
Reply
1 Solution

Accepted Solutions
sabankocal
Voyager
Voyager
477 Views
Registered: ‎08-02-2019

Hi @bfung_2 ,

There are a lot of questions. I'll try my best

I think, this link is very usefull for you. You can find answers there.

The DTG is built into PetaLinux. 
Petalinux uses the Hardware Description File (HDF) as an input into the DTG.
The HDF describes the HW to the DTG.
If no HDF is provided, then PetaLinux will use a default based on the template (ZynqMP in this case).
The devicetree is used to describe the HW to the kernel.

For example you are using a zynq 7020 as I. 

If you use ZC702 design as base, petalinux knows most of the features automatically and can create related device-tree for Petalinux(not Peta-linux).

You can find your generated device tree as pl.dtsi.

Off course, you have a custom board and it contains different interfaces on it.

Then you need to define your extras in system-user.dtsi file. It completes your build(device-tree) according to your custom board. So that you can use your board specific interfaces(ethernet, SFP...)

For example, your custom board has some extrainterfaces from your base eval board(ZC702), but you dont want to use your board specific interfaces, then you dont need to add them in system-user.dtsi.

system-user.dtsi file is also used for different purposes:

  • You can define DMA related address blocks here.
  • You can add iio tag here to use interrupts on Petalinux
  • You can define reserved memory addresses here

All of your setting overwrites setting in pl.dtsi file, if pl.dtsi has same tags in it.

For example you define in Vivado design a Custom Ip Core. It automatically placed on pl.dtsi file after Petalinux-build.

If you want to overwrite it and want to change some registers or some interrupt related settings then you can do it this changings in system-user.dtsi file.

Saban

 

<--- If reply is helpful, please feel free to give Kudos, and close if it answers your question --->

View solution in original post

3 Replies
sabankocal
Voyager
Voyager
478 Views
Registered: ‎08-02-2019

Hi @bfung_2 ,

There are a lot of questions. I'll try my best

I think, this link is very usefull for you. You can find answers there.

The DTG is built into PetaLinux. 
Petalinux uses the Hardware Description File (HDF) as an input into the DTG.
The HDF describes the HW to the DTG.
If no HDF is provided, then PetaLinux will use a default based on the template (ZynqMP in this case).
The devicetree is used to describe the HW to the kernel.

For example you are using a zynq 7020 as I. 

If you use ZC702 design as base, petalinux knows most of the features automatically and can create related device-tree for Petalinux(not Peta-linux).

You can find your generated device tree as pl.dtsi.

Off course, you have a custom board and it contains different interfaces on it.

Then you need to define your extras in system-user.dtsi file. It completes your build(device-tree) according to your custom board. So that you can use your board specific interfaces(ethernet, SFP...)

For example, your custom board has some extrainterfaces from your base eval board(ZC702), but you dont want to use your board specific interfaces, then you dont need to add them in system-user.dtsi.

system-user.dtsi file is also used for different purposes:

  • You can define DMA related address blocks here.
  • You can add iio tag here to use interrupts on Petalinux
  • You can define reserved memory addresses here

All of your setting overwrites setting in pl.dtsi file, if pl.dtsi has same tags in it.

For example you define in Vivado design a Custom Ip Core. It automatically placed on pl.dtsi file after Petalinux-build.

If you want to overwrite it and want to change some registers or some interrupt related settings then you can do it this changings in system-user.dtsi file.

Saban

 

<--- If reply is helpful, please feel free to give Kudos, and close if it answers your question --->

View solution in original post

bfung_2
Contributor
Contributor
380 Views
Registered: ‎07-02-2020

@sabankocal Thanks for your response.

I found some information which I'd like your comment on: https://www.xilinx.com/support/documentation/sw_manuals/xilinx2020_1/ug1144-petalinux-tools-reference-guide.pdf pg. 118. 

Here, the guide suggests that for custom boards, the machine name should be left as template. 

Seems like there is conflicting information?

0 Kudos
Reply
sabankocal
Voyager
Voyager
365 Views
Registered: ‎08-02-2019

Hi @bfung_2 ,

you can think like that:

You have a device-tree, contains two parts:

  • Coming from your selected Chip in Vivado. When you export your hdf file to Petalinux, it can add related features into device-tree(pl.dtsi)
  • Coming from Carrier Board(ZC702...). If you select one of well known development boards, Petalinux can understand which carrier board related interfaces it need to add into your device-tree. For example, you have an Ethernet interface on ZC702, it is automatically added into pl.dtsi.
  • If you do not select any template, then you need to add this carrier board related interfaces into device-tree(system-user.dtsi file) manually, otherwise Petalinux can not know about it.

As a result, I could not see a conflict.

Saban

 

<--- If reply is helpful, please feel free to give Kudos, and close if it answers your question --->