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: 
Scholar ronnywebers
Scholar
872 Views
Registered: ‎10-10-2014

building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

I found (so far) 3 ways to build/run linux on Zynq / Zynq US+ devices (not sure if the list is complete though) :

 

1) http://www.wiki.xilinx.com/Zynq+Linux

-> 'classic / manual' way of building linux components using make/bitbake on the command line (FSBL, U-Boot, Kernel, root fs, ...) 

 

2) http://www.wiki.xilinx.com/PetaLinux

-> seems to be the Xilinx preferred way (?)

 

3) http://www.wiki.xilinx.com/Yocto

-> similar to Petalinux, but for advanced use (?). Only recently starts to appear in Xilinx doc (UG1228)

 

 

UG1228 talks about Petalinux and Yocto, however it does not mention method 1 ... while method 1 is covered by many Xilinx wiki pages...  so why doesn't UG1228 (while being a methodology guide) not mention method 1 / these wiki pages? 

 

I'm having difficulty deciding which of the 3 flows to choose, to see the pro's and con's of each method, I should probably try them all 3, and then decide. However my time is limited, so any guidance / high-level views would help here!

 

-> i.e. will the Petalinux flow disappear in the future, and be 'taken over' by Yocto?

-> why would anyone use method 1, as Petalinux automates so many things?

-> how about version control -> I want to store my 'customisations' to a complete build (FSBL, U-BOOT, kernel, dtsi, extra drivers, menuconfig, ...) in git, and from there recreate everything using a simple script -> which method integrates well with git?

...

 

** kudo if the answer was helpful. Accept as solution if your question is answered **
15 Replies
Highlighted
Xilinx Employee
Xilinx Employee
854 Views
Registered: ‎02-07-2018

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

HI @ronnywebers

 

You can follow this link for manual way of building the code : http://www.wiki.xilinx.com/ZCU102+Image+creation+in+OSL+flow

 

for your info Petalinux flow will not disappear in future.

You can use git for tracking your local changes.

 

Thanks & regards

Aravind

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

 

 

Scholar ronnywebers
Scholar
838 Views
Registered: ‎10-10-2014

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

thanks @aravindb, if I may :

 

1) what would be the advantage of Petalinux over the 'manual' flow?

2) in the manual flow, how would you version control many different projects?  Let me give a specific example:

 

on the very interesting link you shared, take the 'build device tree' part : the repo is cloned and checked out at 'xilinx-v2017.4'

 

then there's a manual modification of the gem3 node in my_dts/system-top.dts

 

now once the file is manually edited, I want only to keep track of the difference that I made on the  git repo, and not track the entire clone of the 'device-tree-xlnx' in my git repo. Now I cannot simply '.gitignore' the folder 'device-tree-xlnx', because the system-top.dts is inside that folder somewhere

 

So I'm puzzled on how to do this : should I keep a copy of the (edited)  systemt-top.dts file, and then using a script :

1) clone my repo from my own server - this repo only contains the edited 'system-top.dts'

2) clone the 'device-tree-xlnx repo'

3) checkout at xilinx-v2017.4'

4) copy & overwrite the system-top.dts with my edited version?

 

is that a / the way of working?

 

the same would then go for all other edits : extra drivers, .menuconfig edits, ... 

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
Scholar ronnywebers
Scholar
837 Views
Registered: ‎10-10-2014

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

btw, I'm still wondering what 'OSL flow' means :-)

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
Explorer
Explorer
791 Views
Registered: ‎09-14-2016

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

Hi @ronnywebers,

 

I think your post is really interesting !! 

 

I have tested this 3 methods and, so in order to help a little, this is my point of vue:

 

Petalinux is made for people who doesn't need to know all about low-level and in my opinion it's really easy to add custom board 

 

Yocto really interesting ( I use it from many years now) You can modify all you want to bluid the smallest rootfs and tiny kernel !

 

With yocto it's really simple to split your work (with local git/svn server) and externals ( provided by Xilinx, Intel, poky ...).

 

OSL is a good method to learn how works an embedded system, you learn the boot process... It's my prefered method to start a new board. You can can compil/modify the kernel in few command and try the first boot.

 

I'm not sure if my reply is helpful but your question was really really interesting!

 

Cheers,

Trigger.

 

PS: I think OSL is for Open Source Lab (but not sure)

Scholar ronnywebers
Scholar
788 Views
Registered: ‎10-10-2014

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

thanks @trigger for sharing that experience!

 

with OSL I have the impression that I better know what is happening, while Petalinux is 'more obscure'. I found it easy to use, but Xilinx would help us when they explained better what is happening under the hood.

 

If I'm correct, Petalinux is a 'stripped' down Yocto (?), where only the elements relevant to Xilinx devices are included. So mabye reading a book about Yocto would help me better understand Petalinux?

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
Scholar ronnywebers
Scholar
770 Views
Registered: ‎10-10-2014

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

I think I've found what 'OSL' means : Open Source Linux.

 

after Googling a while I found this page : http://xilinx.wikidot.com/osl-drivers

 

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
Explorer
Explorer
765 Views
Registered: ‎09-14-2016

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

Hi @ronnywebers,

 

In my opinion (it's maybe false) you are right Petalinux is like a wrapper of Yocto.

 

In order to share a little bit more I think it's difficult to use Petalinux with other platform ( i mean not a Xilinx Platform). 

 

 

So mabye reading a book about Yocto would help me better understand Petalinux?

I think the answer is yes!

 

hope that you will enjoy reading the book

Cheers,

Trigger

0 Kudos
Moderator
Moderator
743 Views
Registered: ‎09-12-2007

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

Yes, I wrote the wiki page as it is useful for custom boards. Petalinux wouldn't be as user friendly for this. The petalinux is for users you just want to create a working linux image without needing to understand what is going on under the hood. Yocto would be more developer friendly as it is easier to patch and would be device agnostic

Ps: OSL is open source linux
0 Kudos
Moderator
Moderator
742 Views
Registered: ‎09-12-2007

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

I'm not sure what you mean with respect tto the device tree. The system-top.dts is output from the device tree generator
0 Kudos
Moderator
Moderator
470 Views
Registered: ‎09-12-2007

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

0 Kudos
Scholar ronnywebers
Scholar
456 Views
Registered: ‎10-10-2014

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

thanks a lot @stephenm, my ZCU102 just arrived :-) 

 

could you explain in a few phrases why one would use Yocto over Petalinux? It's that kind of 'birds-eye' view that I'm looking for in this post. 

 

I'll go through the Yocto flow over the next weeks!

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
Moderator
Moderator
449 Views
Registered: ‎09-12-2007

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

If you are using a Xilinx development board such as the ZCU102, then I would recommend that you use the Petalinux as this will have the BSP that you can use to easily build a Linux Image for your board. The BSP will be board aware, so the PHY, I2C ext that are external to the chip will be added to the devicetree (you would have to do this manually in Yocto). Once you are more confident with the Linux flow, I would recommending using Yocto. However, I would only use the Yocto if I was developing on a custom board.

Scholar ronnywebers
Scholar
445 Views
Registered: ‎10-10-2014

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

thanks @stephenm, that's clear to me regarding petalinux vs Yocto, except :

 

Q1) can I add my own custom board to Petalinux (instead of needing to use Yocto?). Now I edit the .dtsi file in Petalinux to add my board specific stuff, but maybe I can create/add my own bsp to Petalinux?

 

Q2) to close this topic : how would one decide between 'OSL' instead of petalinux/Yocto? I can see many Xilinx wiki pages that use the 'OSL' flow, but there's no mention at all in the Embedded methodology guide (only Petalinux/Yocto are mentioned)

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
Moderator
Moderator
439 Views
Registered: ‎09-12-2007

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

If you are using a custom board, you would have custom uboot files:

u-boot-xlnx\include\configs\<custom_board>.h

u-boot-xlnx\configs\<custom_board>_defconfig

u-boot-xlnx\arch\arm\dts\<custom_board>.dts

 

You could clone the u-boot-xlnx, checkout the matching version in Petalinux, make your changes, and create a patch

git diff Xilinx-v2018.2 > 0001_add_custom_board.patch

Then add this patch to the uboot recipe. See the wiki below for patching uboot in Petalinux:

http://www.wiki.xilinx.com/PetaLinux+Yocto+Tips

 

Note: if you are just changing the zcu102 config, then you can do this in the platform-top.h file in the uboot recipe, and not need to patch the u-boot.

 

You would use the defconfig in the petalinux-config under the uboot config.

 

For the devicetree, you would update the system-user.dtsi in Petalinux Project.

 

For Linux, you can update the bsp.cfg with your custom config options in the recipe-kerne (which you would need to create)

linux_recipe.PNG

 

For Linux, you can update the

 

Moderator
Moderator
295 Views
Registered: ‎12-04-2016

Re: building linux for Zynq : classic linux build vs Petalinux vs Yocto -> how to choose?

Hi @ronnywebers

 

If you think your queries have been answered, kindly mark the appropriate answer thread as an accepted solution to close this topic discussion

 

 

 

0 Kudos